sonata-admin

Could not determine access type for property “translations” in Symfony 3.2.* with Sonata admin project and Sonata translation bundle

江枫思渺然 提交于 2019-12-24 07:56:33
问题 I have installed Sonata admin project in Symfony 3.2.* version. Components that are being used in my project from composer.json file are as following: composer.json file's package snippet "require": { "php": ">=5.5.9", "ext-pdo_sqlite": "*", "a2lix/i18n-doctrine-bundle": "^0.1.0", "a2lix/translation-form-bundle": "^2.1", "doctrine/doctrine-bundle": "^1.6", "doctrine/doctrine-cache-bundle": "^1.2", "doctrine/doctrine-fixtures-bundle": "^2.2", "doctrine/orm": "^2.5", "erusev/parsedown": "^1.5",

SonataAdmin custom form action

£可爱£侵袭症+ 提交于 2019-12-24 05:56:50
问题 I am using SonataAdminBundle and I'd like to know how to add a custom form action in the edit (Something similar to the Save, Update and Close ) There doesn't seem to anything documented about it. I'm trying to add a custom input field that will call a controller or something to update a value and send an email Is there any docs or examples on how to do this? Thanks 回答1: You can add custom form actions by adding new routes. Because when you add new route you need also add action to handle

How to render a multiple choice dropdown with option groups using “sonata_type_model” or symfony “entity”?

不羁的心 提交于 2019-12-24 03:51:33
问题 I'm trying to render a multiple choice selection drop-down similar to the SO question using sonata_type_model or entity type. I have the entity Property with manyToMany to Feature that is oneToMany of FeatureType . The multi-choice drop-down is being implemented in the Property create form. I have found the group_by option. But I got the warning using entity and got the incorrect rendering using sonata_type_model . Attempt 1 ->add('features', 'entity', array( 'class' => 'MyBundle:Feature',

Managing one to many entities in sonata admin bundle

ぃ、小莉子 提交于 2019-12-24 01:18:48
问题 Imagine you are developing a website using symfony2 and it's admin panel using Sonata Admin Bundle and of course imagine you have a class named Product which owns some Images. Image is also a class and you have set in Product a one to many relation-ship to Image class. So every image is owned by a product, so you want to manage Image Admin inside Product Admin classes. So there are some problems you should to face with them. Would you please to tell how? 1. When you delete a product object,

Time picker (no date) in a Sonata-admin form

ぃ、小莉子 提交于 2019-12-24 01:04:10
问题 I'm upgrading a Symfony project's Sonata Admin usage, from Sonata-Admin 2.2 to 2.3, as part of upgrading the overall project to Symfony 2.7. We have a number of 'time' fields (that is, defined in Doctrine as "time", with no meaningful date component.) In Sonata-Admin 2.2 the FormMapper definition was simple: $formMapper ->tab('tab.general') ->add('start', null, array('label' => 'label.start') ->end() and that gave the layout of "half-form-width" Hour and Minute selection boxes, side by side,

Upgrading Sonata from 2.3 to 3.0

别来无恙 提交于 2019-12-23 23:06:22
问题 I have an existing Symfony + SonataAdmin project which we've been running for a few years. I'd like to upgrade it to SonataAdmin 3.x. 3.0 would be a good start, then moving up to 3.x afterwards once we check it's all working. However, I can't seem to get a viable set of composer dependencies to upgrade. The current settings include: "sonata-project/admin-bundle": "~2.3", "sonata-project/core-bundle": "~2.3", "sonata-project/doctrine-orm-admin-bundle": "~2.3", "sonata-project/user-bundle": "~2

SonataMediaBundle - How to use custom file input

*爱你&永不变心* 提交于 2019-12-23 20:45:15
问题 I have a kind of scavenger hunt project in which I am using AngularJS to manage the different questions it may contain. These questions are of different types. Therefore, some may include a file input and some may not. In this project, I am also using Symfony and SonataMediaBundle to manage my files and my images. Since my html model (mostly my forms) can change depending on the actions of the user, I cannot use Symfony's built-in tool to produce forms. Therefore, all my forms are custom made

Use custom column in Sonata Admin list

泄露秘密 提交于 2019-12-23 19:46:11
问题 I created a project with Symfony 4.1, and install Sonata Admin Bundle. In a listing of my categories, I try to add a column which is not related to a field of Category So I did /* Admin/CategoryAdmin.php */ protected function configureListFields(ListMapper $listMapper) { $listMapper ->addIdentifier('name') ->add('test_column', 'string', [ 'template' => 'template_test.html.twig', ]); } And my template. {# templates/template_test.html.twig #} {% extends 'SonataAdminBundle:CRUD:base_list_field

how to override a css of sonata admin bundle in symfony2

痞子三分冷 提交于 2019-12-23 15:30:13
问题 i want to override a css file i.e reside in sonata-project/admin-bundle/Sonata/AdminBundle/Resources/public/bootstrap/css path of sonata admin bundle project. Please help me out. 回答1: One way you can you override the css files of sonata admin but remember this will override the block of stylesheets but still you can call the stylesheets of parent block by calling {{ parent() }} {% block stylesheets %} /* this will override the parent block you can define here your css files*/ <link rel=

how to override a css of sonata admin bundle in symfony2

若如初见. 提交于 2019-12-23 15:27:07
问题 i want to override a css file i.e reside in sonata-project/admin-bundle/Sonata/AdminBundle/Resources/public/bootstrap/css path of sonata admin bundle project. Please help me out. 回答1: One way you can you override the css files of sonata admin but remember this will override the block of stylesheets but still you can call the stylesheets of parent block by calling {{ parent() }} {% block stylesheets %} /* this will override the parent block you can define here your css files*/ <link rel=