You are here

public function purl_path::remove in Persistent URL 6

Same name and namespace in other branches
  1. 7 includes/purl_path.inc \purl_path::remove()

Removes specific modifier from a query string.

Parameters

$q: The current path.

$element: a purl_path_element object

Return value

path string with the modifier removed.

2 calls to purl_path::remove()
purl_path::adjust in includes/purl_path.inc
Rewrite the query string. Note that this is being passed through the custom_url_rewrite_inbound() stack and may *not* directly affect $_GET['q']. See purl_init() for how $_GET['q'] is affected by processors.
purl_path::rewrite in includes/purl_path.inc
Just need to add the value to the front of the path.
1 method overrides purl_path::remove()
purl_pair::remove in includes/purl_pair.inc
Removes specific modifier pair from a query string.

File

includes/purl_path.inc, line 63

Class

purl_path
Path prefixer.

Code

public function remove($q, $element) {
  $args = explode('/', $q);

  // Remove the value from the front of the query string
  if (current($args) === (string) $element->value) {
    array_shift($args);
  }
  return implode('/', $args);
}