public __set (mixed $key, mixed $value) Magic method to pass variables to the views $this->view->products = $products;
public setLayoutsDir (mixed $layoutsDir) Sets the layouts sub-directory. Must be a directory under the views directory. Depending of your platform, always add a trailing slash or backslash $view->setLayoutsDir('../common/layouts/');
public setRenderLevel (mixed $level) Sets the render level for the view //Render the view related to the controller only $this->view->setRenderLevel(View::LEVEL_LAYOUT);
public setMainView (mixed $viewPath) Sets default view name. Must be a file without extension in the views directory //Renders as main view views-dir/base.phtml $this->view->setMainView('base');
public setParamToView (mixed $key, mixed $value) Adds parameters to views (alias of setVar) $this->view->setParamToView('products', $products);
public setTemplateAfter (mixed $templateAfter) Sets a “template after” controller layout
public setTemplateBefore (mixed $templateBefore) Sets a template before the controller layout
public setPartialsDir (mixed $partialsDir) Sets a partials sub-directory. Must be a directory under the views directory. Depending of your platform, always add a trailing slash or backslash $view->setPartialsDir('../common/partials/');
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 setBasePath (mixed $basePath) Sets base path. Depending of your platform, always add a trailing slash or backslash $view->setBasePath(__DIR__ . '/');
Page 65 of 382