Property | Type | Description | |
---|---|---|---|
$_actionName | string | ||
$_content | string | ||
$_controllerName | string | ||
$_layout | false | string | null | ||
$_viewVars | array |
Method | Description | |
---|---|---|
_render ( string $template, array $vars, boolean $directOutput ) : string | ||
dump ( ) | ||
getActionName ( ) : string | Gets the name of the action rendered | |
getContent ( ) : string | Returns cached output from another view stage | |
getControllerName ( ) : string | Gets the name of the controller rendered | |
getVar ( string $name = null ) : mixed | Returns a parameter previously set in the view | |
partial ( string $path, array $vars = [] ) | Renders a partial view | |
pick ( string $view ) : static | Choose a different view to render instead of last-controller/last-action | |
render ( string $controller, string $action ) : static | Executes render process from dispatching data | |
setContent ( string $content ) : static | Externally sets the view content | |
setLayout ( false | string $layout = 'Default' ) : static | ||
setVar ( string $name, mixed $value ) : static | Set a single view parameter | |
setVars ( array $vars ) : static | Adds parameters to view | |
widget ( string $widget, array $options = [], integer | array $cacheOptions = null ) |
public getActionName ( ) : string | ||
return | string |
public getContent ( ) : string | ||
return | string |
public getControllerName ( ) : string | ||
return | string |
Show a partial inside another view
$this->partial('shared/footer');
Show a partial inside another view with parameters
$this->partial('shared/footer', array('content' => $html));
class ProductsController extends \ManaPHP\Mvc\Controller
{
public function saveAction()
{
Do some save stuff...
Then show the list view
$this->view->pick("products/list");
}
}
Shows recent posts view (app/views/posts/recent.phtml)
$view->start()->render('posts', 'recent')->finish();
$this->view->setContent("hello
");
public setContent ( string $content ) : static | ||
$content | string | |
return | static |
$this->view->setVar('products', $products);