Phalcon\Test\Module\View\Engine\Twig::render PHP Method

render() public method

Renders a view using the template engine
public render ( string $path, mixed $params, boolean $mustClean = false )
$path string
$params mixed
$mustClean boolean
    public function render($path, $params, $mustClean = false)
    {
        if (!isset($params['content'])) {
            $params['content'] = $this->_view->getContent();
        }
        if (!isset($params['view'])) {
            $params['view'] = $this->_view;
        }
        $relativePath = str_replace($this->_view->getViewsDir(), '', $path);
        $content = $this->twig->render($relativePath, $params);
        if ($mustClean) {
            $this->_view->setContent($content);
        } else {
            echo $content;
        }
    }