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( 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 boolean|$thisbuild( 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 array|$thiscreateFromArray( array $config )
Configures a view builder instance from serialized config.
$config mixedhelpers( array $helpers null , boolean $merge true )
The helpers to use
$helpers optional null $merge optional true array|$thisjsonSerialize( )
Serializes the view builder object to a value that can be natively serialized and re-used to clone this builder instance.
arrayJsonSerializable::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 string|$thislayoutPath( string|null $path null )
Get/set path for layout files.
$path optional null string|$thisname( string|null $name null )
Get/set the view name
$name optional null array|$thisoptions( 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 array|$thisplugin( string|null|false $name null )
The plugin name to use
$name optional null string|$thisserialize( )
Serializes the view builder object.
stringSerializable::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/<SubFolder> without the .ctp extension.
$name optional null string|$thistemplatePath( string|null $path null )
Get/set path for template files.
$path optional null string|$thistheme( string|null|false $theme null )
The view theme to use.
$theme optional null string|$thisunserialize( string $data )
Unserializes the view builder object.
$data mixedSerializable::unserialize()
© 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.1/class-Cake.View.ViewBuilder.html