public function view($view = null, array $params = array(), $display = false, $exit = false)
    {
        $view_file = CarteBlanche::getContainer()
            ->get('locator')->locateView( $view );
        CarteBlanche::getContainer()->get('config')
            ->getRegistry()->loadStack('views');
        CarteBlanche::getContainer()->get('config')
            ->getRegistry()->setEntry(uniqid(), array(
                'tpl'=>$view,
                'params'=>$params
            ));
        CarteBlanche::getContainer()->get('config')
            ->getRegistry()->saveStack('views', true);
        $output = CarteBlanche::getContainer()->get('template_engine')
            ->render($view_file, $params, $display, $exit);

        if ($display===true) {
            CarteBlanche::getContainer()->get('response')
                ->addContent(null, $output)
                ->send();
            return;
        } else {
            return $output;
        }
    }
public function view($view = null, array $params = array(), $display = false, $exit = false)
    {
        $view_file = CarteBlanche::getContainer()
            ->get('locator')->locateView( $view );
        CarteBlanche::getContainer()->get('config')
            ->getRegistry()->loadStack('views');
        CarteBlanche::getContainer()->get('config')
            ->getRegistry()->setEntry(uniqid(), array(
                'tpl'=>$view,
                'params'=>$params
            ));
        CarteBlanche::getContainer()->get('config')
            ->getRegistry()->saveStack('views', true);
        $output = CarteBlanche::getContainer()->get('template_engine')
            ->render($view_file, $params, $display, $exit);

        if ($display===true) {
            CarteBlanche::getContainer()->get('response')
                ->addContent(null, $output)
                ->send();
            return;
        } else {
            return $output;
        }
    }
public function view ( $ view = null , array $ params = array ( ) , $ display = false , $ exit = false ) { $ view_file = CarteBlanche :: getContainer ( ) -> get ( 'locator' ) -> locateView ( $ view ) ; CarteBlanche :: getContainer ( ) -> get ( 'config' ) -> getRegistry ( ) -> loadStack ( 'views' ) ; CarteBlanche :: getContainer ( ) -> get ( 'config' ) -> getRegistry ( ) -> setEntry ( uniqid ( ) , array ( 'tpl' => $ view , 'params' => $ params ) ) ; CarteBlanche :: getContainer ( ) -> get ( 'config' ) -> getRegistry ( ) -> saveStack ( 'views' , true ) ; $ output = CarteBlanche :: getContainer ( ) -> get ( 'template_engine' ) -> render ( $ view_file , $ params , $ display , $ exit ) ; if ( $ display === true ) { CarteBlanche :: getContainer ( ) -> get ( 'response' ) -> addContent ( null , $ output ) -> send ( ) ; return ; } else { return $ output ; } }
Render a view

@param   string      $view      The view filename in `$views_dir`
@param   array       $params    An array of the parameters passed for the view parsing
@param   bool        $display   Display the view or return it (default is FALSE)
@param   bool        $exit      Exit after rendering (default is FALSE)
@return  string|void
@see     \TemplateEngine\TemplateEngine::render()
Render a view