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)); } return $this->twig->render($this->actionTemplates[$type], ['grid' => $gridView, 'action' => $action, 'data' => $data]); }