public function view(string $template = '', array $variables = []): View
    {
        /** @var \Valkyrja\View\View $view */
        $view = $this->container()->getSingleton(View::class);

        if (\func_num_args() === 0) {
            return $view;
        }

        return $view->make($template, $variables);
    }
public function view(string $template = '', array $variables = []): View
    {
        /** @var \Valkyrja\View\View $view */
        $view = $this->container()->getSingleton(View::class);

        if (\func_num_args() === 0) {
            return $view;
        }

        return $view->make($template, $variables);
    }
public function view ( string $ template = '' , array $ variables = [ ] ) : View { /** @var \Valkyrja\View\View $view */ $ view = $ this -> container ( ) -> getSingleton ( View :: class ) ; if ( \ func_num_args ( ) === 0 ) { return $ view ; } return $ view -> make ( $ template , $ variables ) ; }
Helper function to get a new view.

@param string $template  [optional] The template to use
@param array  $variables [optional] The variables to use

@return \Valkyrja\View\View
Helper function to get a new view .