Symfony,Doctrine Guard Plugin,generator.yml 文件,使用其他模块定制 [英] Symfony, Doctrine Guard Plugin, generator.yml file, customizing by using another module

查看:27
本文介绍了Symfony,Doctrine Guard Plugin,generator.yml 文件,使用其他模块定制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Symfony 1-4 和 sfDoctrineGuardPlugin.

I am using Symfony 1-4 and sfDoctrineGuardPlugin.

我的问题是,在 Doctrine Guard 插件上,正如你所知,每个模块都带有 generator.yml.我需要自定义generator.yml.例如,我需要显示另一个表的(模块的)列.

My question is, on Doctrine Guard Plugin as you know each module came with generator.yml. And i need to customize generator.yml. For example, i need to display another table's (module's) column.

<代码>//例如我在 X 模块,需要根据另一个表/模块的列进行排序...

配置:
列表:
sort: [X, asc]//x 不在我的模块中

与列表/显示相同.我需要显示一些不在我当前模块中的列...

Same thing with list/display. I need to display some column which is not on my current module...

我在网上找不到它.非常感谢您分享您的想法和/或信息,曼.

I couldn't find it on the web. Thanks a lot for sharing your idea and/or information, erman.

推荐答案

  1. 不要介意直接在插件的目录中自定义任何文件.
  2. 通过将 generator.yml 复制到应用程序的模块中来覆盖它.模块必须与插件中的名称相同.请参阅插件剖析".
  3. Symfony 不提供内置功能来按当前模型中不存在的列对项目进行排序.您必须通过覆盖操作类中的 addSortQuery 方法来手动执行此操作.请参阅Symfony 1.4管理生成器对自定义列进行排序".
  1. Never mind to customize any file directly in the plugin's dir.
  2. Override generator.yml by copying it into your application's module. The module must be the same name as in plugin. See "Anatomy of a Plug-in".
  3. Symfony does not provide a built-in functionality to sort items by columns that don't present in current model. You have to do it manually by overriding an addSortQuery method in your actions class. See "Symfony 1.4 admin generator sort on custom column".

希望这会有所帮助.

这篇关于Symfony,Doctrine Guard Plugin,generator.yml 文件,使用其他模块定制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆