FluidTYPO3\Flux\ViewHelpers\AbstractFormViewHelper::getGridFromRenderingContext PHP Метод

getGridFromRenderingContext() защищенный статический Метод

protected static getGridFromRenderingContext ( TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext, string $gridName = 'grid' ) : FluidTYPO3\Flux\Form\Container\Grid
$renderingContext TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
$gridName string
Результат FluidTYPO3\Flux\Form\Container\Grid
    protected static function getGridFromRenderingContext(RenderingContextInterface $renderingContext, $gridName = 'grid')
    {
        $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
        $form = static::getFormFromRenderingContext($renderingContext);
        if (FALSE === $viewHelperVariableContainer->exists(static::SCOPE, static::SCOPE_VARIABLE_GRIDS)) {
            $grid = $form->createContainer('Grid', $gridName, 'Grid: ' . $gridName);
            $grids = array($gridName => $grid);
            $viewHelperVariableContainer->add(static::SCOPE, static::SCOPE_VARIABLE_GRIDS, $grids);
        } else {
            $grids = $viewHelperVariableContainer->get(static::SCOPE, static::SCOPE_VARIABLE_GRIDS);
            if (TRUE === isset($grids[$gridName])) {
                $grid = $grids[$gridName];
            } else {
                $grid = $form->createContainer('Grid', $gridName, 'Grid: ' . $gridName);
                $grids[$gridName] = $grid;
                $viewHelperVariableContainer->addOrUpdate(static::SCOPE, static::SCOPE_VARIABLE_GRIDS, $grids);
            }
        }
        return $grid;
    }