PHP Interface eZ\Publish\Core\MVC\Symfony\View\View

..).
显示文件 Open project: ezsystems/ezpublish-kernel Interface Usage Examples

Public Methods

Method Description
addParameters ( array $parameters ) Adds a hash of parameters to the existing parameters.
getConfigHash ( ) : array | null Returns the config hash.
getControllerReference ( ) : Symfony\Component\HttpKernel\Controller\ControllerReference
getParameter ( string $parameterName ) : mixed Returns parameter value by $parameterName.
getParameters ( ) : array Returns registered parameters.
getResponse ( ) : Response | null Returns the pre-configured Response.
getTemplateIdentifier ( ) : string | Closure Returns the registered template identifier.
getViewType ( )
hasParameter ( string $parameterName ) : boolean Checks if $parameterName exists.
setConfigHash ( array $config ) Injects the config hash that was used to match and generate the current view.
setControllerReference ( Symfony\Component\HttpKernel\Controller\ControllerReference $controllerReference )
setParameters ( array $parameters ) Sets $parameters that will later be injected to the template/closure.
setResponse ( Response $response ) Sets a pre-configured Response that will be used to render the View.
setTemplateIdentifier ( string | Closure $templateIdentifier ) Sets $templateIdentifier to the content view.
setViewType ( $viewType )

Method Details

addParameters() public method

Adds a hash of parameters to the existing parameters.
public addParameters ( array $parameters )
$parameters array

getConfigHash() public method

Returns the config hash.
public getConfigHash ( ) : array | null
return array | null

getControllerReference() public method

public getControllerReference ( ) : Symfony\Component\HttpKernel\Controller\ControllerReference
return Symfony\Component\HttpKernel\Controller\ControllerReference

getParameter() public method

Throws an \InvalidArgumentException if $parameterName is not set.
public getParameter ( string $parameterName ) : mixed
$parameterName string
return mixed

getParameters() public method

Returns registered parameters.
public getParameters ( ) : array
return array

getResponse() public method

Returns the pre-configured Response.
public getResponse ( ) : Response | null
return Symfony\Component\HttpFoundation\Response | null

getTemplateIdentifier() public method

Returns the registered template identifier.

getViewType() public method

public getViewType ( )

hasParameter() public method

Checks if $parameterName exists.
public hasParameter ( string $parameterName ) : boolean
$parameterName string
return boolean

setConfigHash() public method

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.
public setConfigHash ( array $config )
$config array

setControllerReference() public method

public setControllerReference ( Symfony\Component\HttpKernel\Controller\ControllerReference $controllerReference )
$controllerReference Symfony\Component\HttpKernel\Controller\ControllerReference

setParameters() public method

If some parameters were already present, $parameters will replace them.
public setParameters ( array $parameters )
$parameters array Hash of parameters

setResponse() public method

Sets a pre-configured Response that will be used to render the View.
public setResponse ( Response $response )
$response Symfony\Component\HttpFoundation\Response

setTemplateIdentifier() public method

Can be either a valid template identifier such as "MyBundle:subfolder:my_template.html.twig" or a closure. In the case of a closure, it will receive an array of parameters as an argument and must return the result to display. The prototype of the closure must be : function (array $params = []) { Do something to render Must return a string to display } Must throw a \eZ\Publish\Core\Base\Exceptions\InvalidArgumentType exception if $templateIdentifier is invalid.
public setTemplateIdentifier ( string | Closure $templateIdentifier )
$templateIdentifier string | Closure

setViewType() public method

public setViewType ( $viewType )