sonata-admin

SonataDoctrineORM - Model extends

本小妞迷上赌 提交于 2019-12-08 08:15:00
问题 I'm using Sonata with SonataAdmin & SonataOrm as told in several tutorials. I simply would like to remove some default method of DoctrineOrmBundle- ModelManager.php I tried to override the ModelManager by putting <?php namespace Project\AdminBundle\Model; use Sonata\DoctrineORMAdminBundle\Model\ModelManager as ModelManager; class ModelManager extends ModelManager { /** * {@inheritdoc} */ public function getSortParameters(FieldDescriptionInterface $fieldDescription, DatagridInterface $datagrid

Sonata Admin - No Header

て烟熏妆下的殇ゞ 提交于 2019-12-08 07:42:37
问题 I extends "SonataAdminBundle::standard_layout.html.twig and it show me admin theme without header/menu. After the debug code "admin_pool" is not defined I passed from admin_pool from the controller but still not defined. Can you please tell me what am I missing? 回答1: I solved header's problem myself using below code $admin_pool = $this->get('sonata.admin.pool'); return $this->render('ProjectBundle:Controller:page.html.twig', array('admin_pool' => $admin_pool)); 来源: https://stackoverflow.com

Sonata Admin Bundle delete not working in prod

▼魔方 西西 提交于 2019-12-08 07:04:26
问题 I have a following issue: if I try to delete something in sonata admin in prod enviroment after confirmation screen and pressing "yes, delete" nothing happens. In dev everything works fine. Could it be a caching issue? Any settings I could try? 回答1: The problem is in the code that detecting the request method. It should detect DELETE method but it detects all delete operations as POST method instead. Add this line of code in your app.php to fix this: Request::enableHttpMethodParameterOverride

Modifying list view in Sonata

↘锁芯ラ 提交于 2019-12-08 03:36:26
问题 I'm using SonataAdminBundle for a Symfony project and I want to list entities not in table, but using vertical tabs. So, I want to have a tab, corresponding to each entity, so that pushing this tab opens fields selected by configureListFields at the right. Is sonata capable of it? Thanks for your help. 回答1: As mentionned on the SonataAdmin documentation, it is possible override the default templates Sonata uses to render the admin UI: sonata_admin: templates: list: SonataAdminBundle:CRUD:list

Custom Template in Sonata Admin

ⅰ亾dé卋堺 提交于 2019-12-08 02:45:39
问题 I am using Sonata Admin to manage CRUD tasks in my application. In one Admin called Multimedia, which has one-to-many relations with Files and Weblinks, both of which are embedded in the Multimedia form. I have a custom template that renders the fields horizontally and with titles. My question is, do I have to specify two different templates for Files and Weblinks because using a single file has failed, Files renders the embed form how I want it but weblink ignores directive. Here's the Admin

Access POST data from a form in SonataAdmin

℡╲_俬逩灬. 提交于 2019-12-08 00:39:00
问题 I have a simple question, how can I access the raw POST data returned by a form in sonataAdmin? I have a page that is creating forms using Javascript and I need to retrieve the data in those forms. The problem is that those forms are not attributes of the entity so I can't have Sonata admin linking them automatically for me. 回答1: The base admin class provides a getRequest method which returns the Request object. Something like... $request = $this->getRequest(); $postValue = $request->request-

ACL + SonataAdminBundle + SonataUserBundle

无人久伴 提交于 2019-12-07 18:59:34
问题 In my Symfony2 project I managed to setup FOSUserBundle + SonataUserBundle + SonataAdminBundle following official docs. Now comes the time to setup the ACL (Access control list). What I did : Created an AdminClass called AdminReport app/console sonata:admin:setup-acl install ACL for sonata.admin.report update role: ROLE_SONATA_ADMIN_REPORT_GUEST, permissions: ["LIST"] update role: ROLE_SONATA_ADMIN_REPORT_STAFF, permissions: ["LIST","CREATE"] update role: ROLE_SONATA_ADMIN_REPORT_EDITOR,

How to change the “sonata project” link in SonataAdmin?

偶尔善良 提交于 2019-12-07 17:05:59
问题 I have a problem with SonataAdminBundle, I don't find how to change the "sonata project" link in the left board. I have "My title" + one image and under there is "sonata project". How can I change this ? 回答1: In order to customize the content of the block under Sonata Admin (by default it's a link with text sonata project ), you have to modify your app/config/config.yml file by adding this: sonata_admin: # ... templates: # Override default template layout: AcmeAdminBundle::standard_layout

Assert unique validation in Sonata Admin

扶醉桌前 提交于 2019-12-07 10:12:43
问题 I'm using Symfony 2.1 for a project. I use SonataAdminBundle for administration usage. i want to add an assert to my slug property in my admin class.. how can i do this? in my entity i had set the assertion but it seems that it doesn't work here :( related codes: the entity : /* * @ORM\Table(name="default_doctor_specialty") * @UniqueEntity("uniqueSlugName") * @ORM\Entity */ class Test { //.. /** * @var string * @Gedmo\Slug(fields={"name"},unique=false) * * @ORM\Column(name="unique_slug_name",

symfony2.1 bundle version confusion, for symfony and sonata admin / knp menu bundle

谁说我不能喝 提交于 2019-12-07 03:45:03
问题 I want to use symfony2.1 for a new project. I try to install symfony2 with composer. But there were multiple errors/problems and so I have also questions for each problem in bold font style . Sometimes I don't know if I do it the right way. I want to use a stable version so I chosen the 2.1.0 version and not the dev/master. php composer.phar create-project symfony/framework-standard-edition symfony v2.1.0 the result was this: Installing symfony/framework-standard-edition (v2.1.0) - Installing