Class SerializedView
Parent class for view classes generating serialized outputs like JsonView and XmlView.
Constants summary
-
stringNAME_TEMPLATE'templates' -
stringPLUGIN_TEMPLATE_FOLDER'plugin' -
stringTYPE_ELEMENT'element' -
stringTYPE_LAYOUT'layout' -
stringTYPE_TEMPLATE'template'
Properties summary
- $Blocks protected
\Cake\View\ViewBlockViewBlock instance.
- $Breadcrumbs public
\Cake\View\Helper\BreadcrumbsHelper - $Flash public
\Cake\View\Helper\FlashHelper - $Form public
\Cake\View\Helper\FormHelper - $Html public
\Cake\View\Helper\HtmlHelper - $Number public
\Cake\View\Helper\NumberHelper - $Paginator public
\Cake\View\Helper\PaginatorHelper - $Text public
\Cake\View\Helper\TextHelper - $Time public
\Cake\View\Helper\TimeHelper - $Url public
\Cake\View\Helper\UrlHelper - $_config protected
arrayRuntime config
- $_configInitialized protected
boolWhether the config property has already been configured with defaults
- $_current protected
stringThe currently rendering view file. Used for resolving parent files.
- $_currentType protected
stringCurrently rendering an element. Used for finding parent fragments for elements.
- $_defaultConfig protected
arrayDefault config options.
- $_eventClass protected
stringDefault class name for new event objects.
- $_eventManager protected
\Cake\Event\EventManagerInterfaceInstance of the Cake\Event\EventManager this object is using to dispatch inner events.
- $_ext protected
stringFile extension. Defaults to ".php".
- $_helpers protected
\Cake\View\HelperRegistryHelpers collection
- $_parents protected
string[]The names of views and their parents used with View::extend();
- $_passedVars protected
string[]List of variables to collect from the associated controller.
- $_paths protected
string[]Holds an array of paths.
- $_pathsForPlugin protected
string[][]Holds an array of plugin paths.
- $_responseType protected
stringResponse type.
- $_stack protected
string[]Content stack, used for nested templates that all use View::extend();
- $_viewBlockClass protected
stringViewBlock class.
- $autoLayout protected
boolTurns on or off CakePHP's conventional mode of applying layout files. On by default.
- $elementCache protected
stringThe Cache configuration View will use to store cached elements. Changing this will change the default configuration elements are stored under. You can also choose a cache config per element.
- $helpers protected
arrayAn array of names of built-in helpers to include.
- $layout protected
stringThe name of the layout file to render the template inside of. The name specified is the filename of the layout in /templates/Layout without the .php extension.
- $layoutPath protected
stringThe name of the layouts subfolder containing layouts for this View.
- $name protected
stringName of the controller that created the View if any.
- $plugin protected
string|nullThe name of the plugin.
- $request protected
\Cake\Http\ServerRequestAn instance of a \Cake\Http\ServerRequest object that contains information about the current request.
- $response protected
\Cake\Http\ResponseReference to the Response object
- $subDir protected
stringSub-directory for this template file. This is often used for extension based routing.
- $template protected
stringThe name of the template file to render. The name specified is the filename in /templates/
without the .php extension. - $templatePath protected
stringThe name of the subfolder containing templates for this View.
- $theme protected
string|nullThe view theme to use.
- $viewVars protected
arrayAn array of variables
Method Summary
- _checkFilePath() protected
Check that a view file path does not go outside of the defined template paths.
- _getSubPaths() protected
Find all sub templates path, based on $basePath If a prefix is defined in the current request, this method will prepend the prefixed template path to the $basePath, cascading up in case the prefix is nested.
- _inflectTemplateFileName() protected
Change the name of a view template file into underscored format.
- _render() protected
Renders and returns output for given template filename with its array of data. Handles parent/extended templates.
- _renderElement() protected
Renders an element and fires the before and afterRender callbacks for it and writes to the cache if a cache is used
- configShallow() public
Merge provided config with existing config. Unlike
config()which does a recursive merge for nested keys, this method does a simple merge. - element() public
Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
- extend() public
Provides template or element extension/inheritance. Templates can extends a parent template and populate blocks in the parent template.
- getTemplate() public
Get the name of the template file to render. The name specified is the filename in /templates/
without the .php extension. - isAutoLayoutEnabled() public
Returns if CakePHP's conventional mode of applying layout files is enabled.
- log() public
Convenience method to write a message to Log. See Log::write() for more information on writing to logs.
- setRequest() public
Sets the request objects and configures a number of controller properties based on the contents of the request. The properties that get set are:
- setTemplate() public
Set the name of the template file to render. The name specified is the filename in /templates/
without the .php extension.
Method Detail
__construct() public
__construct(?\Cake\Http\ServerRequest $request, ?\Cake\Http\Response $response, ?\Cake\Event\EventManager $eventManager, array $viewOptions)
Constructor
Parameters
-
\Cake\Http\ServerRequest|null$request optional Request instance.
-
\Cake\Http\Response|null$response optional Response instance.
-
\Cake\Event\EventManager|null$eventManager optional EventManager instance.
-
array$viewOptions optional An array of view options
__get() public
__get(string $name)
Magic accessor for helpers.
Parameters
-
string$name Name of the attribute to get.
Returns
mixed_checkFilePath() protected
_checkFilePath(string $file, string $path)
Check that a view file path does not go outside of the defined template paths.
Only paths that contain .. will be checked, as they are the ones most likely to have the ability to resolve to files outside of the template paths.
Parameters
-
string$file The path to the template file.
-
string$path Base path that $file should be inside of.
Returns
stringThe file path
Throws
InvalidArgumentException_configDelete() protected
_configDelete(string $key)
Deletes a single config key.
Parameters
-
string$key Key to delete.
Throws
Cake\Core\Exception\Exceptionif attempting to clobber existing config
_configRead() protected
_configRead(?string $key)
Reads a config key.
Parameters
-
string|null$key Key to read.
Returns
mixed_configWrite() protected
_configWrite(mixed $key, mixed $value, mixed $merge)
Writes a config key.
Parameters
-
string|array$key Key to write to.
-
mixed$value Value to write.
-
bool|string$merge optional True to merge recursively, 'shallow' for simple merge, false to overwrite, defaults to false.
Throws
Cake\Core\Exception\Exceptionif attempting to clobber existing config
_createCell() protected
_createCell(string $className, string $action, ?string $plugin, array $options)
Create and configure the cell instance.
Parameters
-
string$className The cell classname.
-
string$action The action name.
-
string|null$plugin The plugin name.
-
array$options The constructor options for the cell.
Returns
\Cake\View\Cell_elementCache() protected
_elementCache(string $name, array $data, array $options)
Generate the cache configuration options for an element.
Parameters
-
string$name Element name
-
array$data Data
-
array$options Element options
Returns
arrayElement Cache configuration.
_evaluate() protected
_evaluate(string $templateFile, array $dataForView)
Sandbox method to evaluate a template / view script in.
Parameters
-
string$templateFile Filename of the template.
-
array$dataForView Data to include in rendered view.
Returns
stringRendered output
_getElementFileName() protected
_getElementFileName(string $name, bool $pluginCheck)
Finds an element filename, returns false on failure.
Parameters
-
string$name The name of the element to find.
-
bool$pluginCheck optional - if false will ignore the request's plugin if parsed plugin is not loaded
Returns
string|falseEither a string to the element filename or false when one can't be found.
_getLayoutFileName() protected
_getLayoutFileName(?string $name)
Returns layout filename for this template as a string.
Parameters
-
string|null$name optional The name of the layout to find.
Returns
stringFilename for layout file.
Throws
Cake\View\Exception\MissingLayoutExceptionwhen a layout cannot be located
RuntimeException_getSubPaths() protected
_getSubPaths(string $basePath)
Find all sub templates path, based on $basePath If a prefix is defined in the current request, this method will prepend the prefixed template path to the $basePath, cascading up in case the prefix is nested.
This is essentially used to find prefixed template paths for elements and layouts.
Parameters
-
string$basePath Base path on which to get the prefixed one.
Returns
string[]Array with all the templates paths.
_getTemplateFileName() protected
_getTemplateFileName(?string $name)
Returns filename of given action's template file as a string.
CamelCased action names will be under_scored by default. This means that you can have LongActionNames that refer to long_action_names.php templates. You can change the inflection rule by overriding _inflectTemplateFileName.
Parameters
-
string|null$name optional Controller action to find template filename for
Returns
stringTemplate filename
Throws
Cake\View\Exception\MissingTemplateExceptionwhen a template file could not be found.
RuntimeExceptionWhen template name not provided.
_inflectTemplateFileName() protected
_inflectTemplateFileName(string $name)
Change the name of a view template file into underscored format.
Parameters
-
string$name Name of file which should be inflected.
Returns
stringFile name after conversion
_paths() protected
_paths(?string $plugin, bool $cached)
Return all possible paths to find view files in order
Parameters
-
string|null$plugin optional Optional plugin name to scan for view files.
-
bool$cached optional Set to false to force a refresh of view paths. Default true.
Returns
string[]paths
_render() protected
_render(string $templateFile, array $data)
Renders and returns output for given template filename with its array of data. Handles parent/extended templates.
Parameters
-
string$templateFile Filename of the template
-
array$data optional Data to include in rendered view. If empty the current View::$viewVars will be used.
Returns
stringRendered output
Throws
LogicExceptionWhen a block is left open.
_renderElement() protected
_renderElement(string $file, array $data, array $options)
Renders an element and fires the before and afterRender callbacks for it and writes to the cache if a cache is used
Parameters
-
string$file Element file path
-
array$data Data to render
-
array$options Element options
Returns
string_serialize() abstract protected
_serialize(mixed $serialize)
Serialize view vars.
Parameters
-
array|string$serialize The name(s) of the view variable(s) that need(s) to be serialized
Returns
stringThe serialized data.
append() public
append(string $name, mixed $value)
Append to an existing or new block.
Appending to a new block will create the block.
Parameters
-
string$name Name of the block
-
mixed$value optional The content for the block. Value will be type cast to string.
Returns
$thisSee Also
assign() public
assign(string $name, mixed $value)
Set the content for a block. This will overwrite any existing content.
Parameters
-
string$name Name of the block
-
mixed$value The content for the block. Value will be type cast to string.
Returns
$thisSee Also
blocks() public
blocks()
Get the names of all the existing blocks.
Returns
string[]An array containing the blocks.
See Also
cache() public
cache(callable $block, array $options)
Create a cached block of view logic.
This allows you to cache a block of view output into the cache defined in elementCache.
This method will attempt to read the cache first. If the cache is empty, the $block will be run and the output stored.
Parameters
-
callable$block The block of code that you want to cache the output of.
-
array$options optional The options defining the cache key etc.
Returns
stringThe rendered content.
Throws
RuntimeExceptionWhen $options is lacking a 'key' option.
cell() protected
cell(string $cell, array $data, array $options)
Renders the given cell.
Example:
// Taxonomy\View\Cell\TagCloudCell::smallList()
$cell = $this->cell('Taxonomy.TagCloud::smallList', ['limit' => 10]);
// App\View\Cell\TagCloudCell::smallList()
$cell = $this->cell('TagCloud::smallList', ['limit' => 10]); The display action will be used by default when no action is provided:
// Taxonomy\View\Cell\TagCloudCell::display()
$cell = $this->cell('Taxonomy.TagCloud'); Cells are not rendered until they are echoed.
Parameters
-
string$cell You must indicate cell name, and optionally a cell action. e.g.:
TagCloud::smallListwill invokeView\Cell\TagCloudCell::smallList(),displayaction will be invoked by default when none is provided.-
array$data optional Additional arguments for cell method. e.g.:
cell('TagCloud::smallList', ['a1' => 'v1', 'a2' => 'v2'])maps toView\Cell\TagCloud::smallList(v1, v2)-
array$options optional Options for Cell's constructor
Returns
\Cake\View\CellThe cell instance
Throws
Cake\View\Exception\MissingCellExceptionIf Cell class was not found.
BadMethodCallExceptionIf Cell class does not specified cell action.
configShallow() public
configShallow(mixed $key, mixed $value)
Merge provided config with existing config. Unlike config() which does a recursive merge for nested keys, this method does a simple merge.
Setting a specific value:
$this->configShallow('key', $value); Setting a nested value:
$this->configShallow('some.nested.key', $value); Updating multiple config settings at the same time:
$this->configShallow(['one' => 'value', 'another' => 'value']);
Parameters
-
string|array$key The key to set, or a complete array of configs.
-
mixed|null$value optional The value to set.
Returns
$thisdisableAutoLayout() public
disableAutoLayout()
Turns off CakePHP's conventional mode of applying layout files.
Layouts will not be automatically applied to rendered views.
Returns
$thisdispatchEvent() public
dispatchEvent(string $name, ?array $data, ?object $subject)
Wrapper for creating and dispatching events.
Returns a dispatched event.
Parameters
-
string$name Name of the event.
-
array|null$data optional Any value you wish to be transported with this event to it can be read by listeners.
-
object|null$subject optional The object that this event applies to ($this by default).
Returns
\Cake\Event\EventInterfaceelement() public
element(string $name, array $data, array $options)
Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
This realizes the concept of Elements, (or "partial layouts") and the $params array is used to send data to be used in the element. Elements can be cached improving performance by using the cache option.
Parameters
-
string$name Name of template file in the /templates/Element/ folder, or
MyPlugin.templateto use the template element from MyPlugin. If the element is not found in the plugin, the normal view path cascade will be searched.-
array$data optional Array of data to be made available to the rendered view (i.e. the Element)
-
array$options optional -
Array of options. Possible keys are:
-
cache- Can either betrue, to enable caching using the config in View::$elementCache. Or an array If an array, the following keys can be used:-
config- Used to store the cached element in a custom cache configuration. -
key- Used to define the key used in the Cache::write(). It will be prefixed withelement_
-
-
callbacks- Set to true to fire beforeRender and afterRender helper callbacks for this element. Defaults to false. -
ignoreMissing- Used to allow missing elements. Set to true to not throw exceptions. -
plugin- setting to false will force to use the application's element from plugin templates, when the plugin has element with same name. Defaults to true
-
Returns
stringRendered Element
Throws
Cake\View\Exception\MissingElementExceptionWhen an element is missing and `ignoreMissing` is false.
elementExists() public
elementExists(string $name)
Checks if an element exists
Parameters
-
string$name Name of template file in the /templates/Element/ folder, or
MyPlugin.templateto check the template element from MyPlugin. If the element is not found in the plugin, the normal view path cascade will be searched.
Returns
boolSuccess
enableAutoLayout() public
enableAutoLayout(bool $enable)
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.
Parameters
-
bool$enable optional Boolean to turn on/off.
Returns
$thisend() public
end()
End a capturing block. The compliment to View::start()
Returns
$thisSee Also
exists() public
exists(string $name)
Check if a block exists
Parameters
-
string$name Name of the block
Returns
boolextend() public
extend(string $name)
Provides template or element extension/inheritance. Templates can extends a parent template and populate blocks in the parent template.
Parameters
-
string$name The template or element to 'extend' the current one with.
Returns
$thisThrows
LogicExceptionwhen you extend a template with itself or make extend loops.
LogicExceptionwhen you extend an element which doesn't exist
fetch() public
fetch(string $name, string $default)
Fetch the content for a block. If a block is empty or undefined '' will be returned.
Parameters
-
string$name Name of the block
-
string$default optional Default text
Returns
stringThe block content or $default if the block does not exist.
See Also
get() public
get(string $var, mixed $default)
Returns the contents of the given View variable.
Parameters
-
string$var The view var you want the contents of.
-
mixed$default optional The default/fallback content of $var.
Returns
mixedThe content of the named var if its set, otherwise $default.
getConfig() public
getConfig(?string $key, mixed $default)
Get config value.
Currently if config is not set it fallbacks to checking corresponding view var with underscore prefix. Using underscore prefixed special view vars is deprecated and this fallback will be removed in CakePHP 4.1.0.
Parameters
-
string|null$key optional The key to get or null for the whole config.
-
mixed$default optional The return value when the key does not exist.
Returns
mixedConfig value being read.
getConfigOrFail() public
getConfigOrFail(string $key)
Returns the config for this specific key.
The config value for this key must exist, it can never be null.
Parameters
-
string$key The key to get.
Returns
mixedConfiguration data at the named key
Throws
InvalidArgumentExceptiongetCurrentType() public
getCurrentType()
Retrieve the current template type
Returns
stringgetElementPaths() protected
getElementPaths(?string $plugin)
Get an iterator for element paths.
Parameters
-
string|null$plugin The plugin to fetch paths for.
Returns
\GeneratorgetEventManager() public
getEventManager()
Returns the Cake\Event\EventManager manager instance for this object.
You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.
Returns
\Cake\Event\EventManagerInterfacegetLayout() public
getLayout()
Get the name of the layout file to render the template inside of.
The name specified is the filename of the layout in /templates/Layout without the .php extension.
Returns
stringgetLayoutPath() public
getLayoutPath()
Get path for layout files.
Returns
stringgetLayoutPaths() protected
getLayoutPaths(?string $plugin)
Get an iterator for layout paths.
Parameters
-
string|null$plugin The plugin to fetch paths for.
Returns
\GeneratorgetName() public
getName()
Returns the View's controller name.
Returns
stringgetPlugin() public
getPlugin()
Returns the plugin name.
Returns
string|nullgetRequest() public
getRequest()
Gets the request instance.
Returns
\Cake\Http\ServerRequestgetResponse() public
getResponse()
Gets the response instance.
Returns
\Cake\Http\ResponsegetSubDir() public
getSubDir()
Get sub-directory for this template files.
Returns
stringSee Also
getTemplate() public
getTemplate()
Get the name of the template file to render. The name specified is the filename in /templates/
Returns
stringgetTemplatePath() public
getTemplatePath()
Get path for templates files.
Returns
stringgetTheme() public
getTheme()
Get the current view theme.
Returns
string|nullgetVars() public
getVars()
Returns a list of variables available in the current View context
Returns
string[]Array of the set view variable names.
helpers() public
helpers()
Get the helper registry in use by this View class.
Returns
\Cake\View\HelperRegistryinitialize() public
initialize()
Initialization hook method.
Properties like $helpers etc. cannot be initialized statically in your custom view class as they are overwritten by values from controller in constructor. So this method allows you to manipulate them as required after view instance is constructed.
isAutoLayoutEnabled() public
isAutoLayoutEnabled()
Returns if CakePHP's conventional mode of applying layout files is enabled.
Disabled means that layouts will not be automatically applied to rendered views.
Returns
boolloadHelper() public
loadHelper(string $name, array $config)
Loads a helper. Delegates to the HelperRegistry::load() to load the helper
Parameters
-
string$name Name of the helper to load.
-
array$config optional Settings for the helper
Returns
\Cake\View\Helpera constructed helper object.
See Also
loadHelpers() public
loadHelpers()
Load helpers only if serialization is disabled.
Returns
$thislog() public
log(string $message, mixed $level, mixed $context)
Convenience method to write a message to Log. See Log::write() for more information on writing to logs.
Parameters
-
string$message Log message.
-
int|string$level optional Error level.
-
string|array$context optional Additional log data relevant to this message.
Returns
boolSuccess of log write.
pluginSplit() public
pluginSplit(string $name, bool $fallback)
Splits a dot syntax plugin name into its plugin and filename.
If $name does not have a dot, then index 0 will be null. It checks if the plugin is loaded, else filename will stay unchanged for filenames containing dot
Parameters
-
string$name The name you want to plugin split.
-
bool$fallback optional If true uses the plugin set in the current Request when parsed plugin is not loaded
Returns
arrayArray with 2 indexes. 0 => plugin name, 1 => filename.
prepend() public
prepend(string $name, mixed $value)
Prepend to an existing or new block.
Prepending to a new block will create the block.
Parameters
-
string$name Name of the block
-
mixed$value The content for the block. Value will be type cast to string.
Returns
$thisSee Also
render() public
render(?string $template, mixed $layout)
Render view template or return serialized data.
Parameters
-
string|null$template optional The template being rendered.
-
string|false|null$layout optional The layout being rendered.
Returns
stringThe rendered view.
Throws
Cake\View\Exception\SerializationFailureExceptionWhen serialization fails.
renderLayout() public
renderLayout(string $content, ?string $layout)
Renders a layout. Returns output from _render().
Several variables are created for use in layout.
Parameters
-
string$content Content to render in a template, wrapped by the surrounding layout.
-
string|null$layout optional Layout name
Returns
stringRendered output.
Throws
Cake\Core\Exception\Exceptionif there is an error in the view.
reset() public
reset(string $name)
Reset the content for a block. This will overwrite any existing content.
Parameters
-
string$name Name of the block
Returns
$thisSee Also
set() public
set(mixed $name, mixed $value)
Saves a variable or an associative array of variables for use inside a template.
Parameters
-
string|array$name A string or an array of data.
-
mixed$value optional 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.
Returns
$thisThrows
RuntimeExceptionIf the array combine operation failed.
setConfig() public
setConfig(mixed $key, mixed $value, mixed $merge)
Sets the config.
Usage
Setting a specific value:
$this->setConfig('key', $value); Setting a nested value:
$this->setConfig('some.nested.key', $value); Updating multiple config settings at the same time:
$this->setConfig(['one' => 'value', 'another' => 'value']);
Parameters
-
string|array$key The key to set, or a complete array of configs.
-
mixed|null$value optional The value to set.
-
bool$merge optional Whether to recursively merge or overwrite existing config, defaults to true.
Returns
$thisThrows
Cake\Core\Exception\ExceptionWhen trying to set a key that is invalid.
setElementCache() public
setElementCache(string $elementCache)
Set The cache configuration View will use to store cached elements
Parameters
-
string$elementCache Cache config name.
Returns
$thisSee Also
setEventManager() public
setEventManager(\Cake\Event\EventManagerInterface $eventManager)
Returns the Cake\Event\EventManagerInterface instance for this object.
You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.
Parameters
-
\Cake\Event\EventManagerInterface$eventManager the eventManager to set
Returns
$thissetLayout() public
setLayout(string $name)
Set the name of the layout file to render the template inside of.
The name specified is the filename of the layout in /templates/Layout without the .php extension.
Parameters
-
string$name Layout file name to set.
Returns
$thissetLayoutPath() public
setLayoutPath(string $path)
Set path for layout files.
Parameters
-
string$path Path for layout files.
Returns
$thissetPlugin() public
setPlugin(?string $name)
Sets the plugin name.
Parameters
-
string|null$name Plugin name.
Returns
$thissetRequest() public
setRequest(\Cake\Http\ServerRequest $request)
Sets the request objects and configures a number of controller properties based on the contents of the request. The properties that get set are:
- $this->request - To the $request parameter
- $this->plugin - To the value returned by $request->getParam('plugin')
Parameters
-
\Cake\Http\ServerRequest$request Request instance.
Returns
$thissetResponse() public
setResponse(\Cake\Http\Response $response)
Sets the response instance.
Parameters
-
\Cake\Http\Response$response Response instance.
Returns
$thissetSubDir() public
setSubDir(string $subDir)
Set sub-directory for this template files.
Parameters
-
string$subDir Sub-directory name.
Returns
$thisSee Also
setTemplate() public
setTemplate(string $name)
Set the name of the template file to render. The name specified is the filename in /templates/
Parameters
-
string$name Template file name to set.
Returns
$thissetTemplatePath() public
setTemplatePath(string $path)
Set path for templates files.
Parameters
-
string$path Path for template files.
Returns
$thissetTheme() public
setTheme(?string $theme)
Set the view theme to use.
Parameters
-
string|null$theme Theme name.
Returns
$thisstart() public
start(string $name)
Start capturing output for a 'block'
You can use start on a block multiple times to append or prepend content in a capture mode.
// Append content to an existing block.
$this->start('content');
echo $this->fetch('content');
echo 'Some new content';
$this->end();
// Prepend content to an existing block
$this->start('content');
echo 'Some new content';
echo $this->fetch('content');
$this->end(); Parameters
-
string$name The name of the block to capture for.
Returns
$thisSee Also
Property Detail
$Blocks protected
ViewBlock instance.
Type
\Cake\View\ViewBlock$Breadcrumbs public
Type
\Cake\View\Helper\BreadcrumbsHelper$Flash public
Type
\Cake\View\Helper\FlashHelper$Form public
Type
\Cake\View\Helper\FormHelper$Html public
Type
\Cake\View\Helper\HtmlHelper$Number public
Type
\Cake\View\Helper\NumberHelper$Paginator public
Type
\Cake\View\Helper\PaginatorHelper$Text public
Type
\Cake\View\Helper\TextHelper$Time public
Type
\Cake\View\Helper\TimeHelper$Url public
Type
\Cake\View\Helper\UrlHelper$_config protected
Runtime config
Type
array$_configInitialized protected
Whether the config property has already been configured with defaults
Type
bool$_current protected
The currently rendering view file. Used for resolving parent files.
Type
string$_currentType protected
Currently rendering an element. Used for finding parent fragments for elements.
Type
string$_defaultConfig protected
Default config options.
Use ViewBuilder::setOption()/setOptions() in your controlle to set these options.
-
serialize: Option to convert a set of view variables into a serialized response. Its value can be a string for single variable name or array for multiple names. If true all view variables will be serialized. If null or false normal view template will be rendered.
Type
array$_eventClass protected
Default class name for new event objects.
Type
string$_eventManager protected
Instance of the Cake\Event\EventManager this object is using to dispatch inner events.
Type
\Cake\Event\EventManagerInterface$_ext protected
File extension. Defaults to ".php".
Type
string$_helpers protected
Helpers collection
Type
\Cake\View\HelperRegistry$_parents protected
The names of views and their parents used with View::extend();
Type
string[]$_passedVars protected
List of variables to collect from the associated controller.
Type
string[]$_paths protected
Holds an array of paths.
Type
string[]$_pathsForPlugin protected
Holds an array of plugin paths.
Type
string[][]$_responseType protected
Response type.
Type
string$_stack protected
Content stack, used for nested templates that all use View::extend();
Type
string[]$_viewBlockClass protected
ViewBlock class.
Type
string$autoLayout protected
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 templates.
Type
bool$elementCache protected
The Cache configuration View will use to store cached elements. Changing this will change the default configuration elements are stored under. You can also choose a cache config per element.
Type
string$helpers protected
An array of names of built-in helpers to include.
Type
array$layout protected
The name of the layout file to render the template inside of. The name specified is the filename of the layout in /templates/Layout without the .php extension.
Type
string$layoutPath protected
The name of the layouts subfolder containing layouts for this View.
Type
string$name protected
Name of the controller that created the View if any.
Type
string$plugin protected
The name of the plugin.
Type
string|null$request protected
An instance of a \Cake\Http\ServerRequest object that contains information about the current request.
This object contains all the information about a request and several methods for reading additional information about the request.
Type
\Cake\Http\ServerRequest$response protected
Reference to the Response object
Type
\Cake\Http\Response$subDir protected
Sub-directory for this template file. This is often used for extension based routing.
Eg. With an xml extension, $subDir would be xml/
Type
string$template protected
The name of the template file to render. The name specified is the filename in /templates/
Type
string$templatePath protected
The name of the subfolder containing templates for this View.
Type
string$theme protected
The view theme to use.
Type
string|null$viewVars protected
An array of variables
Type
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/4.0/class-Cake.View.SerializedView.html