public function render($view, array $data = array())
    {
        $original_view = $this->view;

        if (!empty($data)) {
            $this->shared_data->merge($data);
        }

        $this->view = $view;

        if (null === $this->layout) {
            $this->yieldView();
        } else {
            require $this->layout;
        }

        if (false !== $this->response->chunked) {
            $this->response->chunk();
        }

        // restore state for parent render()
        $this->view = $original_view;
    }
public function render($view, array $data = array())
    {
        $original_view = $this->view;

        if (!empty($data)) {
            $this->shared_data->merge($data);
        }

        $this->view = $view;

        if (null === $this->layout) {
            $this->yieldView();
        } else {
            require $this->layout;
        }

        if (false !== $this->response->chunked) {
            $this->response->chunk();
        }

        // restore state for parent render()
        $this->view = $original_view;
    }
public function render ( $ view , array $ data = array ( ) ) { $ original_view = $ this -> view ; if ( ! empty ( $ data ) ) { $ this -> shared_data -> merge ( $ data ) ; } $ this -> view = $ view ; if ( null === $ this -> layout ) { $ this -> yieldView ( ) ; } else { require $ this -> layout ; } if ( false !== $ this -> response -> chunked ) { $ this -> response -> chunk ( ) ; } // restore state for parent render() $ this -> view = $ original_view ; }
Renders a view + optional layout

@param string $view  The view to render
@param array $data   The data to render in the view
@return void
Renders a view + optional layout