lib/Controller.php
protected function render($template, $data = [], $status = 200)
    {
        $rendered = View::render($template, $data);

        $this->response->getBody()->write($rendered);

        return $this->getResponse()
            ->withStatus($status)
            ->withHeader('Content-Type', 'text/html; charset=utf-8');
    }
protected function render($template, $data = [], $status = 200)
    {
        $rendered = View::render($template, $data);

        $this->response->getBody()->write($rendered);

        return $this->getResponse()
            ->withStatus($status)
            ->withHeader('Content-Type', 'text/html; charset=utf-8');
    }
protected function render ( $ template , $ data = [ ] , $ status = 200 ) { $ rendered = View :: render ( $ template , $ data ) ; $ this -> response -> getBody ( ) -> write ( $ rendered ) ; return $ this -> getResponse ( ) -> withStatus ( $ status ) -> withHeader ( 'Content-Type' , 'text/html; charset=utf-8' ) ; }
Render a view template with optional data

@param string       $template Relative Path to Template File
@param array|object $data     Associate Array or Object (key => value)
@param int          $status   HTTP status code (100-599, default 200)

@return Response
Render a view template with optional data