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|$this
build( 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\View
Cake\View\Exception\MissingViewException
className( 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|$this
createFromArray( array $config )
Configures a view builder instance from serialized config.
$config
mixed
helpers( array $helpers null , boolean $merge true )
The helpers to use
$helpers
optional null $merge
optional true array|$this
jsonSerialize( )
Serializes the view builder object to a value that can be natively serialized and re-used to clone this builder instance.
array
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 string|$this
layoutPath( string|null $path null )
Get/set path for layout files.
$path
optional null string|$this
name( string|null $name null )
Get/set the view name
$name
optional null array|$this
options( 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|$this
plugin( string|null|false $name null )
The plugin name to use
$name
optional null string|$this
serialize( )
Serializes the view builder object.
string
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/<SubFolder> without the .ctp extension.
$name
optional null string|$this
templatePath( string|null $path null )
Get/set path for template files.
$path
optional null string|$this
theme( string|null|false $theme null )
The view theme to use.
$theme
optional null string|$this
unserialize( string $data )
Unserializes the view builder object.
$data
mixed
Serializable::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