library\App\View::render PHP Method

render() public method

Renders template and injects it to the layout file.
public render ( string $template, array $data = null ) : string
$template string
$data array
return string
    public function render($template, $data = null)
    {
        return parent::render($template, $data);
    }

Usage Example

Example #1
0
 /**
  * Renders template fragment in its own veriable scope.
  * 
  * @param string $template
  * @param array $data
  * @return string
  */
 public function partial($template, $data = array())
 {
     $view = new View();
     $view->setTemplatesDirectory($this->getTemplatesDirectory());
     return $view->render($template, $data);
 }