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
Esempio n. 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);
 }