Class

eZ\Publish\Core\MVC\Symfony\View\BaseView

abstract class BaseView implements View

Methods

__construct($templateIdentifier = null, array $parameters = array(), $viewType = 'full')

setParameters(array $parameters)

addParameters(array $parameters)

Adds a hash of parameters to the existing parameters.

array getParameters()

bool hasParameter(string $parameterName)

Checks if $parameterName exists.

mixed getParameter(string $parameterName)

Returns parameter value by $parameterName.

setTemplateIdentifier(string|Closure $templateIdentifier)

string|Closure getTemplateIdentifier()

setConfigHash(array $config)

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

array|null getConfigHash()

Returns the config hash.

setViewType($viewType)

getViewType()

setControllerReference(ControllerReference $controllerReference)

ControllerReference getControllerReference()

setResponse(Response $response)

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

Response|null getResponse()

Returns the pre-configured Response.

setCacheEnabled($cacheEnabled)

isCacheEnabled()

Details

at line 49
public __construct($templateIdentifier = null, array $parameters = array(), $viewType = 'full')

Parameters

$templateIdentifier
array $parameters
$viewType

Exceptions

InvalidArgumentType

at line 62
public setParameters(array $parameters)

Parameters

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

at line 72
public addParameters(array $parameters)

Adds a hash of parameters to the existing parameters.

Parameters

array $parameters

at line 80
public array getParameters()

Return Value

array

at line 92
public bool hasParameter(string $parameterName)

Checks if $parameterName exists.

Parameters

string $parameterName

Return Value

bool

at line 107
public mixed getParameter(string $parameterName)

Returns parameter value by $parameterName.

Throws an \InvalidArgumentException if $parameterName is not set.

Parameters

string $parameterName

Return Value

mixed

Exceptions

InvalidArgumentException

at line 121
public setTemplateIdentifier(string|Closure $templateIdentifier)

Parameters

string|Closure $templateIdentifier

Exceptions

InvalidArgumentType

at line 133
public string|Closure getTemplateIdentifier()

Return Value

string|Closure

at line 147
public 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

at line 157
public array|null getConfigHash()

Returns the config hash.

Return Value

array|null

at line 162
public setViewType($viewType)

Parameters

$viewType

at line 167
public getViewType()

at line 172
public setControllerReference(ControllerReference $controllerReference)

Parameters

ControllerReference $controllerReference

at line 180
public ControllerReference getControllerReference()

Return Value

ControllerReference

at line 195
public setResponse(Response $response)

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

Parameters

Response $response

at line 200
public Response|null getResponse()

Returns the pre-configured Response.

Return Value

Response|null

at line 205
public setCacheEnabled($cacheEnabled)

Parameters

$cacheEnabled

at line 210
public isCacheEnabled()