$_templatePath
$_templatePath : string|null
The subdirectory to the template.
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()
.
setLayoutPath(string|null $path) : $this
Sets path for layout files.
string|null | $path | Path for layout files. |
None found |
None found |
layoutPath(string|null $path = null) : string|$this
Get/set path for layout files.
string|null | $path | Path for layout files. If null returns current path. |
None found |
enableAutoLayout(boolean $enable = true) : $this
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.
boolean | $enable | Boolean to turn on/off. |
None found |
disableAutoLayout() : $this
Turns off CakePHP's conventional mode of applying layout files.
Setting to off means that layouts will not be automatically applied to rendered views.
None found |
isAutoLayoutEnabled() : boolean|null
Returns if CakePHP's conventional mode of applying layout files is enabled.
Disabled means that layouts will not be automatically applied to rendered views.
None found |
autoLayout(boolean|null $enable = null) : boolean|$this
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.
boolean|null | $enable | Boolean to turn on/off. If null returns current value. |
None found |
setPlugin(string|null|false $name) : $this
Sets the plugin name to use.
False
to remove current plugin name is deprecated as of 3.4.0. Use directly null
instead.
string|null|false | $name | Plugin name. Use null or false to remove the current plugin name. |
None found |
None found |
plugin(string|null|false $name = null) : string|false|null|$this
The plugin name to use
string|null|false | $name | Plugin name. If null returns current plugin. Use false to remove the current plugin name. |
None found |
setHelpers(array $helpers, boolean $merge = true) : $this
Sets the helpers to use.
array | $helpers | Helpers to use. |
boolean | $merge | Whether or not to merge existing data with the new data. |
None found |
None found |
helpers(array|null $helpers = null, boolean $merge = true) : array|$this
The helpers to use
array|null | $helpers | Helpers to use. |
boolean | $merge | Whether or not to merge existing data with the new data. |
None found |
setTheme(string|null|false $theme) : $this
Sets the view theme to use.
False
to remove current theme is deprecated as of 3.4.0. Use directly null
instead.
string|null|false | $theme | Theme name. Use null or false to remove the current theme. |
None found |
None found |
theme(string|null|false $theme = null) : string|false|null|$this
The view theme to use.
string|null|false | $theme | Theme name. If null returns current theme. Use false to remove the current theme. |
None found |
setTemplate(string|null $name) : $this
Sets the name of the view file to render. The name specified is the filename in /src/Template/<SubFolder> without the .ctp extension.
string|null | $name | View file name to set. |
None found |
getTemplate() : string|null
Gets the name of the view file to render. The name specified is the filename in /src/Template/<SubFolder> without the .ctp extension.
None found |
template(string|null $name = null) : string|$this
Get/set the name of the view file to render. The name specified is the filename in /src/Template/<SubFolder> without the .ctp extension.
string|null | $name | View file name to set. If null returns current name. |
None found |
setLayout(string|null|false $name) : $this
Sets 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.
string|null|false | $name | Layout file name to set. |
None found |
getLayout() : string|null|false
Gets the name of the layout file to render the view inside of.
None found |
layout(string|null $name = null) : string|$this
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.
string|null | $name | Layout file name to set. If null returns current name. |
None found |
setOptions(array $options, boolean $merge = true) : $this
Sets additional options for the view.
This lets you provide custom constructor arguments to application/plugin view classes.
array | $options | An array of options. |
boolean | $merge | Whether or not to merge existing data with the new data. |
None found |
None found |
options(array|null $options = null, boolean $merge = true) : array|$this
Set additional options for the view.
This lets you provide custom constructor arguments to application/plugin view classes.
array|null | $options | Either an array of options or null to get current options. |
boolean | $merge | Whether or not to merge existing data with the new data. |
None found |
setName(string|null $name) : $this
Sets the view name.
string|null | $name | The name of the view. |
None found |
None found |
name(string|null $name = null) : string|$this
Get/set the view name
string|null | $name | The name of the view |
None found |
setClassName(string|null $name) : $this
Sets the view classname.
Accepts either a short name (Ajax) a plugin name (MyPlugin.Ajax) or a fully namespaced name (App\View\AppView) or null to use the View class provided by CakePHP.
string|null | $name | The class name for the view. |
None found |
None found |
className(string|null $name = null) : string|$this
Get/set the view classname.
Accepts either a short name (Ajax) a plugin name (MyPlugin.Ajax) or a fully namespaced name (App\View\AppView).
string|null | $name | The class name for the view. Can be a plugin.class name reference, a short alias, or a fully namespaced name. |
None found |
build(array $vars = array(), \Cake\Http\ServerRequest|null $request = null, \Cake\Http\Response|null $response = null, \Cake\Event\EventManager|null $events = null) : \Cake\View\View
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.
array | $vars | The view variables/context to use. |
\Cake\Http\ServerRequest|null | $request | The request to use. |
\Cake\Http\Response|null | $response | The response to use. |
\Cake\Event\EventManager|null | $events | The event manager to use. |
None found |
jsonSerialize() : array
Serializes the view builder object to a value that can be natively serialized and re-used to clone this builder instance.
Serializable array of configuration properties.
None found |
createFromArray(array $config) : $this
Configures a view builder instance from serialized config.
array | $config | View builder configuration array. |
Configured view builder instance.
None found |
None found |
unserialize(string $data) : $this
Unserializes the view builder object.
string | $data | Serialized string. |
Configured view builder instance.
None found |