Provides the set() method for collecting template context.
Once collected context data can be passed to another object. This is done in Controller, TemplateTask and View for example.
$_viewBuilder protected $viewClass public string|null$viewVars public array$_validViewOptions public arrayGet/Set valid view options in the object's _validViewOptions property. The property is created as an empty array if it is not set. If called without any parameters it will return the current list of valid view options. See createView().
createView( string|null $viewClass = null )
Constructs the view class instance based on the current configuration.
$viewClass optional null Cake\View\ViewCake\View\Exception\MissingViewExceptionset( string|array $name , mixed $value = null )
Saves a variable or an associative array of variables for use inside a template.
$name $value optional null Value in case $name is a string (which then works as the key). Unused if $name is an associative array, otherwise serves as the values to $name's keys.
viewBuilder( )
Get the view builder being used.
Cake\View\ViewBuilderviewOptions( string|array|null $options = null , boolean $merge = true )
Get/Set valid view options in the object's _validViewOptions property. The property is created as an empty array if it is not set. If called without any parameters it will return the current list of valid view options. See createView().
$options optional null $merge optional true Whether to merge with or override existing valid View options. Defaults to true.
public string|null
The name of default View class.
$this->viewBuilder()->getClassName()/$this->viewBuilder()->setClassName() instead.public array
Variables for the view.
Deprecated: This property will be removed in 4.x. Inside controller context use $this->set() instead, also see $this->viewBuilder()->getVar(). In view context it will be a protected property View::$viewVars.
[]
public array
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.8/class-Cake.View.ViewVarsTrait.html