FOF30\Controller\Controller::getView PHP Method

getView() public method

Returns a named View object
public getView ( string $name = null, array $config = [] ) : View
$name string The Model name. If null we'll use the modelName variable or, if it's empty, the same name as the Controller
$config array Configuration parameters to the Model. If skipped we will use $this->config
return FOF30\View\View The instance of the Model known to this Controller
    public function getView($name = null, $config = array())
    {
        if (!empty($name)) {
            $viewName = $name;
        } elseif (!empty($this->viewName)) {
            $viewName = $this->viewName;
        } else {
            $viewName = $this->view;
        }
        if (!array_key_exists($viewName, $this->viewInstances)) {
            if (empty($config) && isset($this->config['viewConfig'])) {
                $config = $this->config['viewConfig'];
            }
            $viewType = $this->input->getCmd('format', 'html');
            // Get the model's class name
            $this->viewInstances[$viewName] = $this->container->factory->view($viewName, $viewType, $config);
        }
        return $this->viewInstances[$viewName];
    }