/** * @param $blueprint * * @return array * @throws \InvalidArgumentException */ protected function parseBlueprint($blueprint) { $callback = function (&$value) { if (is_string($value)) { $value = str_replace(':current', '*', $value); } if ($value[0] === ':') { # structure $structure = $this->getStructure($value); $value = $this->parseBlueprint($structure); return; } if (strpos($value, '|') === false) { return; } $parts = preg_split('/\\s?\\|\\s?/', $value); $selector = array_shift($parts); $value = ApistConf::select($selector); foreach ($parts as $part) { $this->addCallbackToFilter($value, $part); } }; if (!is_array($blueprint)) { $callback($blueprint); } else { array_walk_recursive($blueprint, $callback); } return $blueprint; }
public function non_array_blueprint() { return $this->get('/', ApistConf::select('.page_head .title')); }