public setBasePath (mixed $basePath) Sets base path. Depending of your platform, always add a trailing slash or backslash $view->setBasePath(__DIR__ . '/');
public reset () Resets the view component to its factory default values
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 registerEngines (array $engines) Register templating engines $this->view->registerEngines([ '.phtml' => 'Phalcon\Mvc\View\Engine\Php', '.volt' => 'Phalcon\Mvc\View\Engine\Volt', '.mhtml' => 'MyCustomEngine' ]);
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_MAIN_LAYOUT
integer LEVEL_LAYOUT
integer LEVEL_BEFORE_TEMPLATE
Page 66 of 382