You are here

public function purl_pair::rewrite in Persistent URL 7

Same name and namespace in other branches
  1. 6 includes/purl_pair.inc \purl_pair::rewrite()

Just need to add the value to the front of the path.

Overrides purl_path::rewrite

File

includes/purl_pair.inc, line 58

Class

purl_pair
Pair pair prefixer.

Code

public function rewrite(&$path, &$options, $element) {
  if (!_purl_skip($element, $options)) {
    $items = explode('/', $path);
    array_unshift($items, "{$element->value}/{$element->id}");
    $path = implode('/', $items);
  }
}