modX.filterPathSegment
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodX::filterPathSegment¶
Delegates to the static modResource::filterPathSegment() — the pipeline that converts a pagetitle into a Resource alias. In order, it:
- strips tags and decodes entities;
- transliterates and restricts the character set;
- applies word delimiters, lowercases and trims;
- cuts the segment to
friendly_alias_max_lengthwhen the setting is above zero.
The same method runs as the filterPathSegment output filter, and media sources pass upload names through it.
Syntax¶
string filterPathSegment (string $string, [array $options = []])
-
$string(string) text to convert -
$options(array)friendly_alias_*overrides for this call, by default[]
Example¶
$segment = $modx->filterPathSegment('My News Title');
// 'my-news-title'
$segment = $modx->filterPathSegment('My News Title', array(
'friendly_alias_lowercase_only' => false,
));
// 'My-News-Title'
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










