sonata-admin

INVALID MODE : s5a869f19a6c57_equivalents - type : sonata_type_collection - mapping :

社会主义新天地 提交于 2021-02-10 20:22:52
问题 I am building a new feature onto a Symfony 2.8 application using a few Sonata bundles. My Page.php entity definition includes the following mapping: /** * @var ArrayCollection * * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Equivalent", cascade={"all"}) * @ORM\JoinTable(name="page_equivalent", * joinColumns={@ORM\JoinColumn(name="page_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="equivalent_id", referencedColumnName="id", unique=true)} * ) */ private

INVALID MODE : s5a869f19a6c57_equivalents - type : sonata_type_collection - mapping :

好久不见. 提交于 2021-02-10 20:20:46
问题 I am building a new feature onto a Symfony 2.8 application using a few Sonata bundles. My Page.php entity definition includes the following mapping: /** * @var ArrayCollection * * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Equivalent", cascade={"all"}) * @ORM\JoinTable(name="page_equivalent", * joinColumns={@ORM\JoinColumn(name="page_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="equivalent_id", referencedColumnName="id", unique=true)} * ) */ private

How to use existing Symfony FormType in Sonata Admin Bundle configureFormFields?

…衆ロ難τιáo~ 提交于 2021-02-07 06:36:05
问题 SonataAdminBundle gives a method configureFormFields when you extend the Admin class. That method takes a FormMapper class. For the entity that I have created this class for, I have already built a FormType class in the typical Symfony fashion. How can I use that class instead of having to define the form properties again using the FormMapper ? 回答1: something like: public function configureFormFields(FormMapper $formMapper) { $form = new ReviewFormType(); $form->buildForm($formMapper-

Sonata admin export fields with collection fields

Deadly 提交于 2021-01-27 20:01:25
问题 I'm trying to make custom columns for export, but I can't access children. Is there any possibility to do that ? My code at this moment looks like this: public function getExportFields() { return [ 'ID' => 'id', 'Transaction number' => 'transactionNumber', 'Loan account' => 'loan', 'Loan name' => 'loan.name', 'Amount' => 'amount', //'Amount ($)' => '', 'Transaction type' => 'transactionCategory', 'Reference' => 'transactionAssociation.cashTransaction.transactionNumber', 'Date' => 'date' ]; }

Error: There is no `_sonata_admin` defined for the controller

柔情痞子 提交于 2020-06-27 11:44:32
问题 I followed the documentation for adding a custom route. When I click on the button in the list view, I get the error: There is no _sonata_admin defined for the controller ***\UserController and the current route resetPassword The docs: http://sonata-project.org/bundles/admin/master/doc/reference/routing.html My Admin Service is defined as follows: sonata.admin.user: class: ****\Admin\UserAdmin #User Admin tags: - { name: sonata.admin, model_manager: cems_model_manager, manager_type: orm,

How to set flash message in sonata admin Admin Controller

倾然丶 夕夏残阳落幕 提交于 2020-05-28 14:00:49
问题 im looking for a way to set flash message in admin controller of sonata admin bundle, they allow to set flash messages in CRUDController as $this->get('session')->setFlash('sonata_flash_error', 'flash_batch_merge_error'); but not in the Admin Controller, this is my admin contrller use Sonata\AdminBundle\Admin\Admin; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Form\FormMapper; use Sonata\AdminBundle\Route\RouteCollection;

Sonata Admin Action Button to Pre Filtered List

别来无恙 提交于 2020-01-23 07:56:03
问题 I am rather new to Symfony (2 weeks) so forgive my ignorance. I am trying to add a custom action button that will link to a pre filtered list of a RELATED entity. I have done a lot of research but can't quite seem to find what I need. Currently I have two entities Books and Authors with a manyToOne relation ship. I have these set up in Sonata Admin in the usual way and all works well. I even have an author filter on the book list page which I am hoping can be leveraged to accomplish my goal.

Sonata Admin Action Button to Pre Filtered List

房东的猫 提交于 2020-01-23 07:54:10
问题 I am rather new to Symfony (2 weeks) so forgive my ignorance. I am trying to add a custom action button that will link to a pre filtered list of a RELATED entity. I have done a lot of research but can't quite seem to find what I need. Currently I have two entities Books and Authors with a manyToOne relation ship. I have these set up in Sonata Admin in the usual way and all works well. I even have an author filter on the book list page which I am hoping can be leveraged to accomplish my goal.