草庐IT

php - Sonata 批量操作和 Hooks 原则

我用Sonata(Symfony2Bundlehttp://sonata-project.org/about)创建了一个管理面板,并且在preRemoveHook(Doctrine)中添加了一个事件。简而言之,当我删除记录时,运行curl到其他服务。一切正常。但是Sonata也有“批处理操作”,我可以在其中选择多行并选择“删除所有选定的”。但是,如果我选择“删除所有选定的”,curl不会启动。preRemove钩子(Hook)(Doctrine)它没有被调用。有人可以帮助我吗?!谢谢 最佳答案 看来,批量删除操作确实避免了调用pre

php - sonata admin + a2lix + gedmo 可翻译问题

我正在尝试使用sonataadmin+a2lix+gedmotranslatable来翻译我的实体。不幸的是它不起作用,因为我希望在表单中看到我的可翻译字段,而在我的后端我可以看到这个“字段-内容”:我已经学习了这个教程:http://a2lix.fr/bundles/translation-form/http://www.elao.com/blog/symfony-2/doctrine-2/how-to-manage-translations-for-your-object-using-sonataadminbundle.html和包的文档。在这里你可以找到我写的所有代码:https

php - 奏鸣曲管理员 - sonata_type_collection : select from the list of existing entities

我正在尝试使用PageHasImage桥接实体在Page和Image实体之间实现多对多关系。在PageAdmin中,我添加了如下字段:->add('galleryImages','sonata_type_collection',array('cascade_validation'=>false,'by_reference'=>false,'type_options'=>array('delete'=>false)),array('edit'=>'inline','inline'=>'table','sortable'=>'position','admin_code'=>'sonata.

php - 禁用 SonataUserBundle sonata.user.admin.group 服务

我正在使用SonataAdminBundle和SonataUserBundle。SonataUserBundle注册了一个服务sonata.user.admin.group,SonataAdminBundle会自动检测该服务,以在管理仪表板中设置链接以对CRUD操作进行分组。如何禁用sonata.user.admin.group?我一直在遵循Symfony2文档中的食谱:HowtoOverrideanyPartofaBundle-ServicesandConfigurationCompilingtheContainer-CreatingaCompilerPassWorkingwithC

php - Sonata Media Bundle - 如何编写自定义图像缩放器

我正在使用SonataMediaBundle我需要为图像缩放器编写特定行为的代码,因为默认的SimpleResizer和SquareResizer类不符合我的需要。我想要一个简单的图像缩放器,如果我指定了width和height参数,它可以让我准确地调整图像的大小。如果我不指定height参数,我还希望它可以回退到simpleresizer行为。我刚刚搜索了文档,但找不到解决方案。 最佳答案 首先,您必须在您的包中创建一个调整器服务,以便将其放入SonataMediaBundle配置中。#Acme/Bundle/CoreBundle

php - “The block type sonata.Admin.block.admin_list does not exist”

我是Symfony2的新手,在生成我的管理面板时遇到了这个问题。Anexceptionhasbeenoccurredduringtherenderingofatemplate("Theblocktypesonata.Admin.block.admin_listdoesnotexist")inSonataAdminBundle:Core:dashboard.html.twigatline35我正在关注此文档SonataAdminBundle. 最佳答案 你必须在app/config/config.yml中指定所有block,就像在th

php - 如何在 symfony2 中覆盖 sonata admin bundle 的 css

我想覆盖一个css文件,即驻留在sonata-project/admin-bundle/Sonata/AdminBundle/Resources/public/bootstrap/csssonataadminbundle项目的路径中。请帮帮我。 最佳答案 一种方法可以覆盖sonataadmin的css文件,但请记住这将覆盖stylesheetsblock,但您仍然可以通过调用调用父block的stylesheets{{parent()}}{%blockstylesheets%}/*thiswilloverridetheparentb

php - Symfony.4 Sonata AdminBundle 注销错误 : You must activate the logout in your security firewall configuration

登录正常。在/admin/logout出现错误Youmustactivatethelogoutinyoursecurityfirewallconfiguration.在在*\vendor\sonata-project\user-bundle\Controller\AdminSecurityController.php第98行我按照记录将注销设置为true:安全.yml:firewalls:main:pattern:.*#pattern:^/form-login:provider:fos_userbundlecsrf_provider:form.csrf_providerlogin_pa

php - Sonata Admin - 更改订单父类别

在我的网络应用程序中,我有以下类别结构:类别可以是父类别或父类别的子类别。现在我想添加仅更改父类别显示顺序的可能性。这在SonataAdmin中怎么可能轻松实现? 最佳答案 此模型是自连接关系(多对一)。即使您只想更改父类别的订单,您也需要创建一个如下所示的字段。/***@varinteger**@ORM\Column(name="sort",type="integer",options={"unsigned"=true})*/private$sort=0;此字段的默认排序值为0,您可以按sort列的DESC进行排序。因此,较高值的

php - 没有实体的 Symfony 奏鸣曲管理包

有没有办法在没有实体的情况下使用sonataadminbundle-所以没有学说?我需要列出某个目录下的文件,这个列表没有存储在数据库中。我尝试的第一种方法是声明我自己的模型管理器,但有些地方需要原则查询等。我知道,有documentmanagerformongo和sonatamongoadmin,但就我而言,它不是很有帮助。有什么想法吗? 最佳答案 在此处找到的文档中:http://sonata-project.org/bundles/admin/master/doc/reference/getting_started.html看