PHP Interface ManaPHP\Mvc\ViewInterface

Show file Open project: manaphp/manaphp

Public Methods

Method Description
getContent ( ) : string Returns cached output from another view stage
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 view different to render than last-controller/last-action
render ( string $controller, string $action ) 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 Adds parameter to view
setVars ( array $vars ) : static Adds parameters to view
widget ( string $widget, array $vars = [], integer | array $cacheOptions = null ) Renders a widget

Method Details

getContent() public method

Returns cached output from another view stage
public getContent ( ) : string
return string

getVar() public method

Returns a parameter previously set in the view
public getVar ( string $name = null ) : mixed
$name string
return mixed

partial() public method

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));
public partial ( string $path, array $vars = [] )
$path string
$vars array

pick() public method

Choose a view different to render than last-controller/last-action
public pick ( string $view ) : static
$view string
return static

render() public method

Executes render process from dispatching data
public render ( string $controller, string $action )
$controller string
$action string

setContent() public method

Externally sets the view content
public setContent ( string $content ) : static
$content string
return static

setLayout() public method

public setLayout ( false | string $layout = 'Default' ) : static
$layout false | string
return static

setVar() public method

Adds parameter to view
public setVar ( string $name, mixed $value ) : static
$name string
$value mixed
return static

setVars() public method

Adds parameters to view
public setVars ( array $vars ) : static
$vars array
return static

widget() public method

Renders a widget
public widget ( string $widget, array $vars = [], integer | array $cacheOptions = null )
$widget string
$vars array
$cacheOptions integer | array