modResource.getAliasPath
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 moremodResource.getAliasPath¶
Builds the alias path that becomes the Resource uri. When uri_override is set and uri is not empty, the frozen value is returned unchanged. Otherwise the alias is cleaned and prefixed with the ancestors when the context has use_alias_path. The path ends with the content type extension, or with container_suffix for a folder.
An empty $alias falls back to the cleaned pagetitle when the context has automatic_alias, and to the Resource ID when it does not. $fields lets you compute the path for values that are not stored on the object yet.
Syntax¶
string getAliasPath ([string $alias = '' [, array $fields = array()]])
-
$alias(string) alias to build the path from, by default'' -
$fields(array) field values to use instead of the Resource's own, by defaultarray()
Example¶
$resource = $modx->getObject('modResource', array('id' => 5));
$uri = $resource->getAliasPath('about-us');
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










