You are here

protected function crumbs_Container_WildcardData::wildcardValue in Crumbs, the Breadcrumbs suite 7.2

Helper: Resolve wildcards..

Parameters

string $key: Key that we are looking for.

Return value

mixed The value for this key.

2 calls to crumbs_Container_WildcardData::wildcardValue()
crumbs_Container_WildcardData::buildPrefixedData in lib/Container/WildcardData.php
Helper: Actually build the prefixed container.
crumbs_Container_WildcardData::valueAtKey in lib/Container/WildcardData.php
Determine the value for the rule specified by the key.

File

lib/Container/WildcardData.php, line 135

Class

crumbs_Container_WildcardData

Code

protected function wildcardValue($key) {
  $fragments = explode('.', $key);
  $partial_key = array_shift($fragments);
  $value = $this->fallback;
  while (!empty($fragments)) {
    if (isset($this->data[$partial_key . '.*'])) {
      $value = $this->data[$partial_key . '.*'];
    }
    $partial_key .= '.' . array_shift($fragments);
  }
  return $value;
}