function view_alias_make_pattern in View Alias 7
Convert the views path to one with tokens embedded in it.
2 calls to view_alias_make_pattern()
File
- ./
view_alias.module, line 64 - Hook implementations for view alias module integration.
Code
function view_alias_make_pattern($alias, $token_list) {
$path = $alias->path;
$count = 0;
// Replace each % with a token from the list.
$path = preg_replace(array_fill(0, count($token_list), '/%/'), $token_list, $path, 1, $count);
// Remove used tokens
$token_list = array_slice($token_list, $count);
// Tack on remaining tokens, if any, separated by '/'.
if ($token_list) {
$path = preg_replace('/\\/?$/', '/' . implode('/', $token_list), $path);
}
return $path;
}