PHP Class Neos\FluidAdaptor\Core\Widget\AbstractWidgetViewHelper

Inheritance: extends Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper, implements Neos\FluidAdaptor\Core\ViewHelper\Facets\ChildNodeAccessInterface
Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$ajaxWidget boolean If set to TRUE, it is an AJAX widget.
$controller AbstractWidgetController This needs to be filled by the individual subclass using property injection.
$escapeOutput boolean
$storeConfigurationInSession boolean You then need to manually add the serialized configuration data to your links, by setting "includeWidgetContext" to TRUE in the widget link and URI ViewHelpers.

Public Methods

Method Description
compile ( string $argumentsName, string $closureName, string &$initializationPhpCode, TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node, TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler $compiler ) : string
initializeArguments ( ) : void Registers the widgetId viewhelper
initializeArgumentsAndRender ( ) : string Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper.
injectAjaxWidgetContextHolder ( AjaxWidgetContextHolder $ajaxWidgetContextHolder ) : void
injectWidgetContext ( WidgetContext $widgetContext ) : void
resetState ( ) : void Resets the ViewHelper state by creating a fresh WidgetContext
setChildNodes ( array $childNodes ) : void Stores the syntax tree child nodes in the Widget Context, so they can be rendered with lateron.

Protected Methods

Method Description
getAjaxWidgetConfiguration ( ) : array Generate the configuration for this widget in AJAX context.
getNonAjaxWidgetConfiguration ( ) : array Generate the configuration for this widget in non-AJAX context.
getWidgetConfiguration ( ) : array Generate the configuration for this widget. Override to adjust.
initiateSubRequest ( ) : Response Initiate a sub request to $this->controller. Make sure to fill $this->controller via Dependency Injection.

Private Methods

Method Description
initializeWidgetContext ( ) : void Initialize the Widget Context, before the Render method is called.
initializeWidgetIdentifier ( ) : void The widget identifier is unique on the current page, and is used in the URI as a namespace for the widget's arguments.
passArgumentsToSubRequest ( ActionRequest $subRequest ) : void Pass the arguments of the widget to the sub request.

Method Details

compile() public method

public compile ( string $argumentsName, string $closureName, string &$initializationPhpCode, TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node, TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler $compiler ) : string
$argumentsName string
$closureName string
$initializationPhpCode string
$node TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode
$compiler TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler
return string

getAjaxWidgetConfiguration() protected method

By default, returns getWidgetConfiguration(). Should become API later.
protected getAjaxWidgetConfiguration ( ) : array
return array

getNonAjaxWidgetConfiguration() protected method

By default, returns getWidgetConfiguration(). Should become API later.
protected getNonAjaxWidgetConfiguration ( ) : array
return array

getWidgetConfiguration() protected method

Generate the configuration for this widget. Override to adjust.
protected getWidgetConfiguration ( ) : array
return array

initializeArguments() public method

Registers the widgetId viewhelper
public initializeArguments ( ) : void
return void

initializeArgumentsAndRender() public method

Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper.
public initializeArgumentsAndRender ( ) : string
return string the rendered ViewHelper.

initiateSubRequest() protected method

Initiate a sub request to $this->controller. Make sure to fill $this->controller via Dependency Injection.
protected initiateSubRequest ( ) : Response
return Neos\Flow\Http\Response the response of this request.

injectAjaxWidgetContextHolder() public method

public injectAjaxWidgetContextHolder ( AjaxWidgetContextHolder $ajaxWidgetContextHolder ) : void
$ajaxWidgetContextHolder AjaxWidgetContextHolder
return void

injectWidgetContext() public method

public injectWidgetContext ( WidgetContext $widgetContext ) : void
$widgetContext WidgetContext
return void

resetState() public method

Resets the ViewHelper state by creating a fresh WidgetContext
public resetState ( ) : void
return void

setChildNodes() public method

Stores the syntax tree child nodes in the Widget Context, so they can be rendered with lateron.
public setChildNodes ( array $childNodes ) : void
$childNodes array The SyntaxTree Child nodes of this ViewHelper.
return void

Property Details

$ajaxWidget protected property

If set to TRUE, it is an AJAX widget.
protected bool $ajaxWidget
return boolean

$controller protected property

This needs to be filled by the individual subclass using property injection.
protected AbstractWidgetController,Neos\FluidAdaptor\Core\Widget $controller
return AbstractWidgetController

$escapeOutput protected property

protected bool $escapeOutput
return boolean

$storeConfigurationInSession protected property

You then need to manually add the serialized configuration data to your links, by setting "includeWidgetContext" to TRUE in the widget link and URI ViewHelpers.
protected bool $storeConfigurationInSession
return boolean