src/Mvc/Controller.php
protected function view($file, array $params = []): TwigRenderer
    {
        $this->eventHandler->trigger(BeforeLoadView::class, [
            'file' => $file,
            'params' => $params,
        ]);

        /** @var TwigRenderer $renderer */
        $renderer = $this->app->make(TwigRenderer::class);

        return $renderer->loadWithController($this, $file, $params);
    }
protected function view($file, array $params = []): TwigRenderer
    {
        $this->eventHandler->trigger(BeforeLoadView::class, [
            'file' => $file,
            'params' => $params,
        ]);

        /** @var TwigRenderer $renderer */
        $renderer = $this->app->make(TwigRenderer::class);

        return $renderer->loadWithController($this, $file, $params);
    }
protected function view ( $ file , array $ params = [ ] ) : TwigRenderer { $ this -> eventHandler -> trigger ( BeforeLoadView :: class , [ 'file' => $ file , 'params' => $ params , ] ) ; /** @var TwigRenderer $renderer */ $ renderer = $ this -> app -> make ( TwigRenderer :: class ) ; return $ renderer -> loadWithController ( $ this , $ file , $ params ) ; }
Loads the given view file with the given parameters.

@param string $file
@param array  $params
@return TwigRenderer
Loads the given view file with the given parameters .