public setLayout (mixed $layout) Change the layout to be used instead of using the name of the latest controller name $this->view->setLayout('main');
public render (string $controllerName, string $actionName, [array $params]) Executes render process from dispatching data // Shows recent posts view (app/views/posts/recent.phtml) $view->start()->render('posts', 'recent')->finish();
public reset () Resets the view component to its factory default values
public setContent (mixed $content) Externally sets the view content $this->view->setContent("<h1>hello</h1>");
integer LEVEL_LAYOUT
integer LEVEL_AFTER_TEMPLATE
public pick (mixed $renderView) Choose a different view to render instead of last-controller/last-action use Phalcon\Mvc\Controller; class ProductsController extends Controller { public function saveAction() { // Do some save stuff... // Then show the list view $this->view->pick("products/list"); } }
public partial (mixed $partialPath, [mixed $params]) Renders a partial view // Show a partial inside another view $this->partial('shared/footer'); // Show a partial inside another view with parameters $this->partial('shared/footer', ['content' => $html]);
integer LEVEL_NO_RENDER
integer LEVEL_BEFORE_TEMPLATE
Page 66 of 382