Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZ\Publish\Core\MVC\Symfony\View\BaseView Class Reference
Inheritance diagram for eZ\Publish\Core\MVC\Symfony\View\BaseView:

## Public Member Functions
| __construct ($templateIdentifier=null, array $parameters=[], $viewType='full')
| setParameters (array $parameters)
| addParameters (array $parameters)
| Adds a hash of parameters to the existing parameters. More...
| getParameters ()
| hasParameter ($parameterName)
| Checks if $parameterName exists. More...
| getParameter ($parameterName)
| Returns parameter value by $parameterName. More...
| setTemplateIdentifier ($templateIdentifier)
| getTemplateIdentifier ()
| setConfigHash (array $config)
| Injects the config hash that was used to match and generate the current view. More...
| getConfigHash ()
| Returns the config hash. More...
| setViewType ($viewType)
| getViewType ()
| setControllerReference (ControllerReference $controllerReference)
| getControllerReference ()
| setResponse (Response $response)
| Sets a pre-configured Response that will be used to render the View. More...
| getResponse ()
| Returns the pre-configured Response. More...
| setCacheEnabled ($cacheEnabled)
| isCacheEnabled ()

## Protected Member Functions
| getInternalParameters ()
| Override to return internal parameters that will be added to the ones returned by getParameter(). More...

## Protected Attributes
| $templateIdentifier
| $parameters = []
| $configHash = []

## Private Attributes
| $viewType = 'full'
| $controllerReference
| $response
| $isCacheEnabled = true

## Detailed Description

Definition at line 13 of file BaseView.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\MVC\Symfony\View\BaseView::__construct | ( |  | $templateIdentifier = `null`,
|  | array | $parameters = `[]`,
|  |  | $viewType = `'full'`
| ) |  |

Parameters

  string | \Closure | $templateIdentifier | Valid path to the template. Can also be a closure.
  string | $viewType |
  array | $parameters | Hash of parameters to pass to the template/closure.

Exceptions

Definition at line 43 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$parameters, eZ\Publish\Core\MVC\Symfony\View\BaseView\$templateIdentifier, eZ\Publish\Core\MVC\Symfony\View\BaseView\$viewType, and eZ\Publish\Core\MVC\Symfony\View\BaseView\setTemplateIdentifier().

## Member Function Documentation

## ◆ addParameters()

eZ\Publish\Core\MVC\Symfony\View\BaseView::addParameters | ( | array | $parameters | ) |

Adds a hash of parameters to the existing parameters.

Parameters

  array | $parameters |

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 66 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$parameters.

Referenced by eZ\Publish\Core\MVC\Symfony\Controller\Content\QueryController\runQuery().

## ◆ getConfigHash()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getConfigHash | ( |  | ) |

Returns the config hash.

Returns
  array|null

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 151 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$configHash.

## ◆ getControllerReference()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getControllerReference | ( |  | ) |

Returns
  \Symfony\Component\HttpKernel\Controller\ControllerReference

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 174 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$controllerReference.

## ◆ getInternalParameters()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getInternalParameters | ( |  | ) |
| protected

Override to return internal parameters that will be added to the ones returned by getParameter().

Returns
  array

Reimplemented in eZ\Publish\Core\MVC\Symfony\View\LoginFormView, eZ\Publish\Core\MVC\Symfony\View\ContentView, and eZ\Publish\Core\MVC\Symfony\View\BlockView.

Definition at line 184 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\getParameters().

## ◆ getParameter()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getParameter | ( |  | $parameterName | ) |

Returns parameter value by $parameterName.

Throws an \InvalidArgumentException if $parameterName is not set.

Parameters

  string | $parameterName |

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 101 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\hasParameter().

Referenced by eZ\Publish\Core\QueryType\QueryParameterContentViewQueryTypeMapper\extractParametersFromContentView(), eZ\Publish\Core\QueryType\QueryParameterContentViewQueryTypeMapper\map(), and eZ\Publish\Core\MVC\Symfony\Controller\Content\QueryController\runQuery().

## ◆ getParameters()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getParameters | ( |  | ) |

Returns
  array

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 74 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$parameters, and eZ\Publish\Core\MVC\Symfony\View\BaseView\getInternalParameters().

## ◆ getResponse()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getResponse | ( |  | ) |

Returns the pre-configured Response.

Returns
  \Symfony\Component\HttpFoundation\Response|null

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 194 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$response.

## ◆ getTemplateIdentifier()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getTemplateIdentifier | ( |  | ) |

Returns
  string|\Closure

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 127 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$templateIdentifier.

## ◆ getViewType()

eZ\Publish\Core\MVC\Symfony\View\BaseView::getViewType | ( |  | ) |

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 161 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$viewType.

## ◆ hasParameter()

eZ\Publish\Core\MVC\Symfony\View\BaseView::hasParameter | ( |  | $parameterName | ) |

Checks if $parameterName exists.

Parameters

  string | $parameterName |

Returns
  bool

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 86 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\getParameter(), and eZ\Publish\Core\QueryType\QueryParameterContentViewQueryTypeMapper\map().

## ◆ isCacheEnabled()

eZ\Publish\Core\MVC\Symfony\View\BaseView::isCacheEnabled | ( |  | ) |

Definition at line 204 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$isCacheEnabled.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\setCacheEnabled().

## ◆ setCacheEnabled()

eZ\Publish\Core\MVC\Symfony\View\BaseView::setCacheEnabled | ( |  | $cacheEnabled | ) |

Definition at line 199 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\isCacheEnabled().

## ◆ setConfigHash()

eZ\Publish\Core\MVC\Symfony\View\BaseView::setConfigHash | ( | array | $config | ) |

Injects the config hash that was used to match and generate the current view.

Typically, the hash would have as keys:

- template : The template that has been matched
- match : The matching configuration, including the matcher "identifier" and what has been passed to it.
- matcher : The matcher object.

Parameters

  array | $config |

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 141 of file BaseView.php.

## ◆ setControllerReference()

eZ\Publish\Core\MVC\Symfony\View\BaseView::setControllerReference | ( | ControllerReference | $controllerReference | ) |

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 166 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$controllerReference.

## ◆ setParameters()

eZ\Publish\Core\MVC\Symfony\View\BaseView::setParameters | ( | array | $parameters | ) |

Parameters

  array | $parameters | Hash of parameters to pass to the template/closure

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 56 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$parameters.

## ◆ setResponse()

eZ\Publish\Core\MVC\Symfony\View\BaseView::setResponse | ( | Response | $response | ) |

Sets a pre-configured Response that will be used to render the View.

Parameters

  Response | $response |

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 189 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$response.

## ◆ setTemplateIdentifier()

eZ\Publish\Core\MVC\Symfony\View\BaseView::setTemplateIdentifier | ( |  | $templateIdentifier | ) |

Parameters

  string | \Closure | $templateIdentifier |

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 115 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$templateIdentifier.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\__construct().

## ◆ setViewType()

eZ\Publish\Core\MVC\Symfony\View\BaseView::setViewType | ( |  | $viewType | ) |

Implements eZ\Publish\Core\MVC\Symfony\View\View.

Definition at line 156 of file BaseView.php.

References eZ\Publish\Core\MVC\Symfony\View\BaseView\$viewType.

## Member Data Documentation

## ◆ $configHash

eZ\Publish\Core\MVC\Symfony\View\BaseView::$configHash = []
| protected

Definition at line 22 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\getConfigHash().

## ◆ $controllerReference

eZ\Publish\Core\MVC\Symfony\View\BaseView::$controllerReference
| private

Definition at line 28 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\getControllerReference(), and eZ\Publish\Core\MVC\Symfony\View\BaseView\setControllerReference().

## ◆ $isCacheEnabled

eZ\Publish\Core\MVC\Symfony\View\BaseView::$isCacheEnabled = true
| private

Definition at line 34 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\isCacheEnabled().

## ◆ $parameters

eZ\Publish\Core\MVC\Symfony\View\BaseView::$parameters = []
| protected

Definition at line 19 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BlockView\__construct(), eZ\Publish\Core\MVC\Symfony\View\BaseView\__construct(), eZ\Publish\Core\MVC\Symfony\View\BaseView\addParameters(), eZ\Publish\Core\MVC\Symfony\View\ContentView\getInternalParameters(), eZ\Publish\Core\MVC\Symfony\View\BaseView\getParameters(), and eZ\Publish\Core\MVC\Symfony\View\BaseView\setParameters().

## ◆ $response

eZ\Publish\Core\MVC\Symfony\View\BaseView::$response
| private

Definition at line 31 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\getResponse(), and eZ\Publish\Core\MVC\Symfony\View\BaseView\setResponse().

## ◆ $templateIdentifier

eZ\Publish\Core\MVC\Symfony\View\BaseView::$templateIdentifier
| protected

Definition at line 16 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BlockView\__construct(), eZ\Publish\Core\MVC\Symfony\View\BaseView\__construct(), eZ\Publish\Core\MVC\Symfony\View\BaseView\getTemplateIdentifier(), and eZ\Publish\Core\MVC\Symfony\View\BaseView\setTemplateIdentifier().

## ◆ $viewType

eZ\Publish\Core\MVC\Symfony\View\BaseView::$viewType = 'full'
| private

Definition at line 25 of file BaseView.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\BaseView\__construct(), eZ\Publish\Core\MVC\Symfony\View\BaseView\getViewType(), and eZ\Publish\Core\MVC\Symfony\View\BaseView\setViewType().

The documentation for this class was generated from the following file:

- BaseView.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.