symfony-sonata

SonataProductBundle (symfony 2.8) instead of showing product create form there is “No object types available” button appearing

倾然丶 夕夏残阳落幕 提交于 2019-12-08 06:15:35
问题 There are Sonata Admin with enabled SonataProductBundle. Product entity configured accordingly to documentation. But, upon attempting to create new "Product" in admin panel, "No object types available" button appears instead of edit form of. Here are the configurations: config.yml imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: services.yml } - { resource: sonata/sonata_product.yml } - { resource: '@ApplicationSonataProductBundle/Resources/config/product.yml

Raw filter on Sonata Admin Bundle configureShowFields

好久不见. 提交于 2019-12-08 05:15:03
问题 I'm doing a project with Symfony2 and Sonata Admin Bundle. How I can apply the filter raw of twig (to display formated text) in action configureShowFields? I would not override Sonata templates... The code of my configureShowFields: protected function configureShowFields(ShowMapper $showMapper) { $showMapper ->add('active') ->add('title') ->add('subtitle') // I need this field with twig RAW filter ->add('description') //I need this field with twig RAW filter ->add('url') ->add('date') ->add(

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

SonataAdminBundle Security roles

喜夏-厌秋 提交于 2019-12-06 16:39:41
I'm trying to secure some admin in SonataAdminBundle I add SonataUserBundle with fosUserBundle for login. So I can add users, groups and roles in security.yml role_hierarchy: ROLE_ADMIN: ROLE_ADMIN ROLE_IT: ROLE_IT ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_IT] access_control: - { path: ^/sonata/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/sonata/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/sonata/login-check$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/sonata, role: [ROLE_ADMIN] } - { path: ^/sonata/api/monolog, role: [ROLE_IT] } I have to be connected to access Sonata

Custom Template in Sonata Admin

女生的网名这么多〃 提交于 2019-12-06 14:34:36
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 Code class MultimediaAdmin extends Admin { // Fields to be shown on create/edit forms protected

How to translate labels in Sonata Admin Bundle

ぃ、小莉子 提交于 2019-12-06 05:12:27
I'm using Symfony 2.3 with Sonata Admin Bundle. I know that I can translate a label in this way: ->add('shortDescription', null, array('label'=>'shortDescriptionTranslated')) But this is possible only with "configureFormFields" method, not for dataGrid and listFields. Can you provide me a complete example for translating labels in global way? I have looked here ( Labels in Sonata Admin Bundle ) but I have no idea what to write in the xliff file. Thanks! Did you review the translation documentation from the Sonata Project website: http://www.sonata-project.org/bundles/admin/master/doc/reference

How to extends Sonata\\DoctrineORMAdminBundle\\Model\\ModelManager

喜你入骨 提交于 2019-12-06 01:58:48
I want some changes in ModelMangaer then I was extending ModelManager but It's not working. I don't know why ? Any one tell me why it is not working? File where I extend Sonata\DoctrineORMAdminBundle\Model\ModelManager-> <?php use Sonata\DoctrineORMAdminBundle\Model\ModelManager; class ModelManager extends ModelManager { /** * {@inheritdoc} */ public function getSortParameters(FieldDescriptionInterface $fieldDescription, DatagridInterface $datagrid) { $values = $datagrid->getValues(); $values = $_GET['filter']; if ($fieldDescription->getName() == $values['_sort_by']) { if ($values['_sort_order

Exporting one to many relationship on sonata admin

怎甘沉沦 提交于 2019-12-05 10:42:16
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 function getExportFields() { return array('name','tel','email','deviceType','postedOn','createdAt',

SonataUserBundle override form profile

戏子无情 提交于 2019-12-05 05:42:28
问题 I am using SonataUserBundle and I am trying to override the edit profile form, but I am not sure about the services.yml and the config.yml. Here is the code. ProfileType.php namespace Application\Sonata\UserBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; use Sonata\UserBundle\Form\Type\ProfileType as BaseType; class ProfileType extends BaseType { public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $builder->add(

using sonata_type_collection against a custom form type instead of a property/relationship with another entity

杀马特。学长 韩版系。学妹 提交于 2019-12-05 05:31:27
问题 is it possible to use sonata_type_collection against a custom form type instead of a property/relationship with another entity? Something like this: $formMapper->add('foo', 'sonata_type_collection', array('type' => new \myVendor\myBundleBundle\Form\Type\BlockType() )); Which throws me the following error The current field `contingut` is not linked to an admin. Please create one for the target entity : `` EDIT: Something like this did the trick: $formMapper->add('contingut', 'collection',