/** * @param string $path * @param array $accessors * @return mixed|null */ public function getByPath($path, array $accessors = array()) { $value = VariableExtractor::extract($this->variables, $path, $accessors); if ($value !== NULL) { return $value; } foreach ($this->variableProviders as $provider) { $value = $provider->getByPath($path, $accessors); if ($value !== NULL) { return $value; } } return NULL; }
/** * Get a variable by dotted path expression, retrieving the * variable from nested arrays/objects one segment at a time. * If the second variable is passed, it is expected to contain * extraction method names (constants from VariableExtractor) * which indicate how each value is extracted. * * @param string $path * @return mixed */ public function getByPath($path, array $accessors = array()) { return VariableExtractor::extract($this->variables, $path, $accessors); }
/** * Get a variable by dotted path expression, retrieving the * variable from nested arrays/objects one segment at a time. * * @param string $path * @return mixed */ public function getByPath($path) { return VariableExtractor::extract($this->variables, $path); }