1

I want to make aliases for different languages in my own modules code. For that reason I want to apply all the general replace patterns of pathauto to a string. For example replace spaces by seperators and special characters.

Is there a function, which does exactly that?

1 Answers1

0

I think there's something useful in pathauto's .inc file which may be useful for you. see sites/all/modules/pathauto/pathauto.inc you may find that pathauto_cleanstring() does some of what you are looking for.

Since you are calling another modules function it might be safest to check if the function exists before calling it in case the module is not installed or the include file has not loaded.

if function_exists('pathauto_cleanstring') {
    $cleaned = pathauto_cleanstring($sometext);
}
digitalsean
  • 391
  • 1
  • 9