Sylius\Bundle\ResourceBundle\Grid\Renderer\TwigGridRenderer::renderAction PHP Method

renderAction() public method

public renderAction ( Sylius\Component\Grid\View\GridViewInterface $gridView, Sylius\Component\Grid\Definition\Action $action, $data = null )
$gridView Sylius\Component\Grid\View\GridViewInterface
$action Sylius\Component\Grid\Definition\Action
    public function renderAction(GridViewInterface $gridView, Action $action, $data = null)
    {
        $type = $action->getType();
        if (!isset($this->actionTemplates[$type])) {
            throw new \InvalidArgumentException(sprintf('Missing template for action type "%s".', $type));
        }
        $options = $this->optionsParser->parseOptions($action->getOptions(), $gridView->getRequestConfiguration()->getRequest(), $data);
        return $this->twig->render($this->actionTemplates[$type], ['grid' => $gridView, 'action' => $action, 'data' => $data, 'options' => $options]);
    }