symfony 2.3 - SonataAdmin change template list for Admin Users -
i new user in sonata admin + fosuserbunle. need create new template list when user admin. check , redirect in crud controller or in sonata admin.
if need admin class , change style template, best option redirect in de sonata admin class. overwrite gettemplate() method.
class yourentityadmin extends admin { public function gettemplate($name) { if ($this->configurationpool->getcontainer()->get('security.context')->isgranted('role_admin')) { switch ($name) { case 'list': return 'yourbundle:entity:list.html.twig'; default: return parent::gettemplate($name); } } else { return parent::gettemplate($name); } }
Comments
Post a Comment