Provides an API for iteratively building a view up.
Once you have configured the view and established all the context you can create a view instance with build().
$_autoLayout protected boolean$_className protected stringThe view class name to use. Can either use plugin notation, a short name or a fully namespaced classname.
$_helpers protected array$_layout protected string$_layoutPath protected string$_name protected string$_options protected array$_plugin protected string$_template protected string$_templatePath protected string$_theme protected stringTurns on or off CakePHP's conventional mode of applying layout files. On by default. Setting to off means that layouts will not be automatically applied to rendered views.
Serializes the view builder object to a value that can be natively serialized and re-used to clone this builder instance.
Get/set the name of the layout file to render the view inside of. The name specified is the filename of the layout in /src/Template/Layout without the .ctp extension.
Get/set the name of the view file to render. The name specified is the filename in /src/Template/
autoLayout( boolean|null $autoLayout null )
Turns on or off CakePHP's conventional mode of applying layout files. On by default. Setting to off means that layouts will not be automatically applied to rendered views.
$autoLayout optional null Cake\View\ViewBuilderbuild( array $vars [] , Cake\Network\Request $request null , Cake\Network\Response $response null , Cake\Event\EventManager $events null )
Using the data in the builder, create a view instance.
If className() is null, App\View\AppView will be used. If that class does not exist, then Cake\View\View will be used.
$vars optional [] Cake\Network\Request $request optional null Cake\Network\Response $response optional null Cake\Event\EventManager $events optional null Cake\View\ViewCake\View\Exception\MissingViewExceptionclassName( string|null $name null )
Get/set the view classname.
Accepts either a short name (Ajax) a plugin name (MyPlugin.Ajax) or a fully namespaced name (App\View\AppView).
$name optional null The class name for the view. Can be a plugin.class name reference, a short alias, or a fully namespaced name.
Cake\View\ViewBuildercreateFromArray( array $config )
Configures a view builder instance from serialized config.
$config helpers( array $helpers null , boolean $merge true )
The helpers to use
$helpers optional null $merge optional true Cake\View\ViewBuilderjsonSerialize( )
Serializes the view builder object to a value that can be natively serialized and re-used to clone this builder instance.
JsonSerializable::jsonSerialize() layout( string|null $name null )
Get/set the name of the layout file to render the view inside of. The name specified is the filename of the layout in /src/Template/Layout without the .ctp extension.
$name optional null Cake\View\ViewBuilderlayoutPath( string|null $path null )
Get/set path for layout files.
$path optional null Cake\View\ViewBuildername( string|null $name null )
Get/set the view name
$name optional null Cake\View\ViewBuilderoptions( array $options null , boolean $merge true )
Set additional options for the view.
This lets you provide custom constructor arguments to application/plugin view classes.
$options optional null $merge optional true Cake\View\ViewBuilderplugin( string|null|false $name null )
The plugin name to use
$name optional null Plugin name. If null returns current plugin. Use false to remove the current plugin name.
Cake\View\ViewBuilderserialize( )
Serializes the view builder object.
Serializable::serialize() template( string|null $name null )
Get/set the name of the view file to render. The name specified is the filename in /src/Template/
$name optional null Cake\View\ViewBuildertemplatePath( string|null $path null )
Get/set path for template files.
$path optional null Cake\View\ViewBuildertheme( string|null|false $theme null )
The view theme to use.
$theme optional null Theme name. If null returns current theme. Use false to remove the current theme.
Cake\View\ViewBuilderunserialize( string $data )
Unserializes the view builder object.
$data Serializable::unserialize() protected string
The view class name to use. Can either use plugin notation, a short name or a fully namespaced classname.
protected array
Additional options used when constructing the view.
This options array lets you provide custom constructor arguments to application/plugin view classes.
[]
© 2005–2016 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.
http://api.cakephp.org/3.2/class-Cake.View.ViewBuilder.html