You are here

public function purl_querystring::parse in Persistent URL 6

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

Tear apart the path and iterate thought it looking for valid values.

Overrides purl_processor::parse

File

includes/purl_querystring.inc, line 41

Class

purl_querystring
Querystring processor.

Code

public function parse($valid_values, $qs) {
  $elements = array();
  parse_str($qs, $elements);
  $parsed = array();
  foreach ($elements as $k => $v) {
    if (isset($valid_values[$k])) {
      $parsed[$k] = $valid_values[$k];
      $parsed[$k]['id'] = $v;
    }
  }
  return purl_path_elements($this, $parsed);
}