PHP Класс ManaPHP\Mvc\View

Наследование: extends ManaPHP\Component, implements ManaPHP\Mvc\ViewInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_actionName string
$_content string
$_controllerName string
$_layout false | string | null
$_viewVars array

Открытые методы

Метод Описание
_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 )

Описание методов

_render() публичный Метод

public _render ( string $template, array $vars, boolean $directOutput ) : string
$template string
$vars array
$directOutput boolean
Результат string

dump() публичный Метод

public dump ( )

getActionName() публичный Метод

Gets the name of the action rendered
public getActionName ( ) : string
Результат string

getContent() публичный Метод

Returns cached output from another view stage
public getContent ( ) : string
Результат string

getControllerName() публичный Метод

Gets the name of the controller rendered
public getControllerName ( ) : string
Результат string

getVar() публичный Метод

Returns a parameter previously set in the view
public getVar ( string $name = null ) : mixed
$name string
Результат mixed

partial() публичный Метод

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() публичный Метод

class ProductsController extends \ManaPHP\Mvc\Controller { public function saveAction() { Do some save stuff... Then show the list view $this->view->pick("products/list"); } }
public pick ( string $view ) : static
$view string
Результат static

render() публичный Метод

Shows recent posts view (app/views/posts/recent.phtml) $view->start()->render('posts', 'recent')->finish();
public render ( string $controller, string $action ) : static
$controller string
$action string
Результат static

setContent() публичный Метод

$this->view->setContent("

hello

");
public setContent ( string $content ) : static
$content string
Результат static

setLayout() публичный Метод

public setLayout ( false | string $layout = 'Default' ) : static
$layout false | string
Результат static

setVar() публичный Метод

$this->view->setVar('products', $products);
public setVar ( string $name, mixed $value ) : static
$name string
$value mixed
Результат static

setVars() публичный Метод

Adds parameters to view
public setVars ( array $vars ) : static
$vars array
Результат static

widget() публичный Метод

public widget ( string $widget, array $options = [], integer | array $cacheOptions = null )
$widget string
$options array
$cacheOptions integer | array

Описание свойств

$_actionName защищенное свойство

protected string $_actionName
Результат string

$_content защищенное свойство

protected string $_content
Результат string

$_controllerName защищенное свойство

protected string $_controllerName
Результат string

$_layout защищенное свойство

protected false|string|null $_layout
Результат false | string | null

$_viewVars защищенное свойство

protected array $_viewVars
Результат array