render() public method

Renders template to output.
public render ( $name, array $params = [], $block = NULL ) : void
$params array
return void
Exemplo n.º 1
0
 public function render($toString = false)
 {
     if (!$toString) {
         self::$engine->render(__DIR__ . '/default.latte', $this->getParameters());
     } else {
         return self::$engine->renderToString(__DIR__ . '/default.latte', $this->getParameters());
     }
     return '';
 }
Exemplo n.º 2
0
 public function render($viewFile, $data, $return = false)
 {
     $latte = new Engine();
     $latte->setTempDirectory('runtime');
     if ($return) {
         return $latte->renderToString($viewFile, $data);
     } else {
         return $latte->render($viewFile, $data);
     }
 }
Exemplo n.º 3
0
	/**
	 * Renders template to output.
	 * @return void
	 */
	public function render($file = NULL, array $params = array())
	{
		$this->latte->render($file ?: $this->file, $params + $this->params);
	}
Exemplo n.º 4
0
 /**
  * @param $template <directory>/<file>.latte convention (inside app/templates folder).
  * @param null $data
  * @return string rendered HTML
  */
 function render($template, $data = null)
 {
     $this->latte->render(ROOT_DIR . "/app/templates/{$template}.latte", $data ? $data : $this->data);
 }