/** * Renders the given content within the layout * * @param string $content * @return string */ public function renderLayout($content) { $layout = new View(); $layout->setScriptPath($this->auth->getLayoutScriptPath()); $layout->assign(array('content' => $content, 'title' => $this->auth->getTitle(), 'view' => $this->view)); return $layout->render($this->auth->getLayoutScript()); }
public function getExamples() { $view = new View(); $view->setScriptPath(__DIR__ . '/view-scripts'); return $view->render('group-column-not-set-examples.phtml'); }
/** * Render a partial view. By default, the same script path used by this * view is passed along. This escaper from this view is also passed to * the partial. * * @param string $template * @param array $data * @param string $scriptPath * @return string */ public function partial($template, array $data, $scriptPath = null) { $partial = new View($this->escaper); $partial->assignInstance('headscript', $this->headScript()); $partial->assignInstance('headlink', $this->headLink()); // Pass along any custom helper class assignments to the newly created partial foreach ($this->helperClasses as $name => $className) { $partial->registerHelper($name, $className); } foreach ($this->helpers as $name => $helper) { if ($helper instanceof PageDelegateInterface) { /* @var $partialHelper PageDelegateInterface */ $partialHelper = $partial->helper($name); $partialHelper->setPage($helper->getPage()); } } $partial->setScriptPath($scriptPath ?: $this->scriptPath)->assign($data); return $partial->render($template); }
/** * You can call renderView() directly from your render() method. Or, if * your render method produces no output itself, the component will call * this method itself to automatically render your view script. * * @return string */ public function renderView() { return $this->view->render($this->inflectViewScriptName()); }
public function getExamples() { $view = new View(); $view->setScriptPath(__DIR__ . '/view-scripts'); return $view->render('group-key-not-present-in-resultset-examples.phtml'); }