81 $this->widgetContext = $this->objectManager->get(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
104 $this->widgetContext->setControllerObjectName(get_class($this->controller));
105 $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
106 $pluginName = $this->controllerContext->getRequest()->getPluginName();
107 $this->widgetContext->setParentExtensionName($extensionName);
108 $this->widgetContext->setParentPluginName($pluginName);
109 $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
110 $this->widgetContext->setParentPluginNamespace($pluginNamespace);
111 $this->widgetContext->setWidgetViewHelperClassName(get_class($this));
112 if ($this->ajaxWidget === TRUE) {
113 $this->ajaxWidgetContextHolder->store($this->widgetContext);
125 $rootNode = $this->objectManager->get(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
126 foreach ($childNodes as $childNode) {
127 $rootNode->addChildNode($childNode);
129 $this->widgetContext->setViewHelperChildNodes($rootNode, $this->renderingContext);
151 if (isset($this->controller)) {
152 throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException(
'initiateSubRequest() can not be called if there is no valid controller extending TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController. Got "' . get_class($this->controller) .
'" in class "' . get_class($this) .
'".', 1289422564);
154 throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException(
'initiateSubRequest() can not be called if there is no controller inside $this->controller. Make sure to add a corresponding injectController method to your WidgetViewHelper class "' . get_class($this) .
'".', 1284401632);
156 $subRequest = $this->objectManager->get(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
157 $subRequest->setWidgetContext($this->widgetContext);
159 $subResponse = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
160 $this->controller->processRequest($subRequest, $subResponse);
171 $arguments = $this->controllerContext->getRequest()->getArguments();
172 $widgetIdentifier = $this->widgetContext->getWidgetIdentifier();
174 if (isset(
$arguments[$widgetIdentifier][
'action'])) {
175 $subRequest->setControllerActionName(
$arguments[$widgetIdentifier][
'action']);
176 unset(
$arguments[$widgetIdentifier][
'action']);
178 $subRequest->setArguments(
$arguments[$widgetIdentifier]);
191 if (!$this->viewHelperVariableContainer->exists(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper',
'nextWidgetNumber')) {
194 $widgetCounter = $this->viewHelperVariableContainer->get(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper',
'nextWidgetNumber');
196 $widgetIdentifier =
'@widget_' . $widgetCounter;
197 $this->viewHelperVariableContainer->addOrUpdate(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetViewHelper',
'nextWidgetNumber', $widgetCounter + 1);
198 $this->widgetContext->setWidgetIdentifier($widgetIdentifier);