Skip to content

Instantly share code, notes, and snippets.

@sepiariver
Created January 24, 2017 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sepiariver/908ef21b73690d3519999140d38b31a3 to your computer and use it in GitHub Desktop.
Save sepiariver/908ef21b73690d3519999140d38b31a3 to your computer and use it in GitHub Desktop.
Use the MODX filterPathSegment method to filter a string value into valid URL syntax. Useful for HTML attribute values as well.
<?php
$options = $modx->getOption('options', $scriptProperties, $modx->getOption('friendly_alias_restrict_chars_pattern'), true);
return $modx->filterPathSegment($input, array('friendly_alias_restrict_chars_pattern' => $options));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment