sonata-admin

No thumbnails generated

随声附和 提交于 2019-12-23 12:11:51
问题 I am using Sonata Media Bundle with Symfony2.3 in my project. When I override youtube provider sonata.media.provider.youtube . Everything working fine. No errors or anything but in /Web/uploads/media no thumbnails generated but in my admin dashboard show me : /uploads/media/default/0001/01/thumb_9_default_small.jpg. I don't know how but when I am not override sonata.media.provider.youtube then thumbnails generated in /web/uploads/media/ Like : /web/uploads/media/default/0001/01/thumb_9

Sonata admin enhanced view for security roles

落花浮王杯 提交于 2019-12-23 04:45:46
问题 In sonata admin the roles are based on admin services name with CRUD export and master permissions but the way it looks not so user friendly to create groups for others user or assign specific permissions to a user considering an example for sonata admin post module the service for admin is named as sonata.news.admin.post and for that service generated roles will look like ROLE_SONATA_NEWS_ADMIN_POST_EDIT ROLE_SONATA_NEWS_ADMIN_POST_LIST ROLE_SONATA_NEWS_ADMIN_POST_CREATE ROLE_SONATA_NEWS

How to get the defined field in sonataadmin query builder?

喜夏-厌秋 提交于 2019-12-23 04:27:03
问题 There is the following code $form->with('Item')->add('parent', null, array( 'label' => 'Category', 'required' => true, 'query_builder' => function($er) use ($id) { $qb = $er->createQueryBuilder('p'); if ($id){ $qb->where('p.id <> :id') ->setParameter('id', $id); } $qb->orderBy('p.root, p.lft', 'ASC'); return $qb; } ......... Result is the entity-objects collection which is given to the string (__toString method). It return name-field. But I need get the another field - url. How to get url

Sonata and Gedmo\References doctrine extension doesn't work ( Class does not exist )

夙愿已清 提交于 2019-12-23 01:12:48
问题 I want to link the doctrine orm entity and doctrine odm document and use them in sonataAdminBundle in configureFormFields Method of the Admin Class. I've established the @Gedmo\References doctrine-extension and it works just fine when i'm trying to access the linked models from controller. But now I need to do it from SonataAdminBundle - to make an UI to add the linked documents to the user entity. Here is my entity: <?php namespace Application\Sonata\UserBundle\Entity; use Doctrine\ORM

Symfony2 - Entire child entity in form and Twig template

雨燕双飞 提交于 2019-12-22 11:29:14
问题 In a Sonata admin form, I'd like to display all images related to the current object. Don't need to edit them. I managed to get this working with an entity field type and its property option to select the image URL as label so I can call all pictures in the template : ->add('image', 'entity', array( 'class' => 'Hop\HopBundle\Entity\Image', 'property' => 'image_url', 'query_builder' => function($er) use ($object) { return $er->createQueryBuilder('i') ->where('i.object = :object') -

Exporting one to many relationship on sonata admin

情到浓时终转凉″ 提交于 2019-12-22 07:13:12
问题 I have tried to search online for a definite solution to this question but there's really no concrete solution for newbies out there. I have an Entry which has many EntryListing. In my EntryAdmin listMapper, i comfortably can list entries by a statement as simple as ->add('listings') which simply returns the listings as defined in the EntryListing __toString() function. Is there a way to achieve the same when exporting the data by overiding the getExportFields() functions as below: public

Problems showing fields with Sonata Admin - Symfony 2.0

∥☆過路亽.° 提交于 2019-12-22 00:05:51
问题 I want to show some fields of an object with SonataAdmin. One of these fields is an integer (status) in the database, but I don't want to show the integer, else a specific string depending on the value of this field. public function configureListFields(ListMapper $listMapper) { $listMapper ->addIdentifier('name') ->add('notice') ->add('start') ->add('end') ->add('status') ; } Is it possible? And a second question: in the same example, I want to add a field which is not mapped in the database

Method “currentAncestor” for object “Knp\Menu\MenuItem” does not exist in Sonata

梦想的初衷 提交于 2019-12-21 21:34:50
问题 I'm new to Symfony2 and I just installed it along with fosUserBUndle 1.3.3, Sonata Admin BUndle, and Sonata User BUndle. Now I get an error that I cannot resolve. Here is my error: (url localhost:8000/profile/ ) : Method "currentAncestor" for object "Knp\Menu\MenuItem" does not exist in SonataBlockBundle:Block:block_side_menu_template.html.twig at line 29 I am able to login succesfully, but I get this error after login. Any help would be greatly appreciated. Thanks 回答1: open file block_side

Adding customised validation rules to SonataUserBundle

限于喜欢 提交于 2019-12-21 08:22:58
问题 I have installed SonataUserBundle according to the docs and it all works fine. Except that I cannot add custom validation rules. My understanding is that the new rules should be added to a new Validation Group and then config.yml is updated to tell SonataUserBundle (or FosUserBundle) to add the new rules to the validation sequence. I have tried this, in various ways, but the new rules just don't seem to be picked up at all... Here's the configuration I'm using... (For the sake of this example

Use Sonata Field Type on normal Form Class

青春壹個敷衍的年華 提交于 2019-12-21 05:32:10
问题 I'm trying to insert custom sonata form field type on the front page, not in SonataAdmin, something like this: $form = $this->createFormBuilder($content) ->add('titleEs', 'text', array('required' => true, 'label' => 'label.title.spanish', 'attr' => array('class' => 'col-xs-12 form-control input-lg'))) ->add('contentEs', 'ckeditor', array('required' => true,'label' => 'label.content.spanish', 'attr' => array('class' => 'col-xs-12'))) ->add('titleEn', 'text', array('required' => true,'label' =>