Phrozn\Site\View\Base::getParams PHP Method

getParams() public method

Get view parameters from both front matter and general site options
public getParams ( string $param = null, string $default = [] ) : array
$param string Parameter to get value for. Levels are separated with dots
$default string Default value to fetch if param is not found
return array
    public function getParams($param = null, $default = array())
    {
        $params = array();
        $params['page'] = $this->getFrontMatter();
        $params['site'] = $this->getSiteConfig();
        $params['phr'] = $this->getAppConfig();
        $params['current'] = array();
        $inputFile = $this->getInputFile();
        $pos = strpos($inputFile, '/entries');
        if (false !== $pos) {
            $params['current']['phr_template'] = substr($this->getInputFile(), $pos + 8 + 1);
        }
        // also create merged configuration
        if (isset($params['page'], $params['site'])) {
            $params['this'] = array_merge($params['page'], $params['site'], $params['current']);
        } else {
            $params['this'] = $params['current'];
        }
        if (null !== $param) {
            $params = $this->locateParam($params, $param);
        }
        return isset($params) ? $params : $default;
    }