App\Core\Controller::getLayout PHP Method

getLayout() public method

Return a Layout instance.
public getLayout ( string | null $layout = null, array $data = [] ) : Template\Template | View\View
$layout string | null
$data array
return Template\Template | View\View
    public function getLayout($layout = null, array $data = array())
    {
        // Adjust the current used Layout.
        $layout = $layout ?: $this->layout;
        if ($layout instanceof View) {
            return $layout->with($data);
        } else {
            if (is_string($layout)) {
                return Template::make($layout, $data, $this->template);
            }
        }
        throw new BadMethodCallException('Method not available for the current Layout');
    }