Symfony 管理生成器标题覆盖
我想在我的executeIndex 方法的标题中添加过滤器列表。有谁知道是否可以从executeIndex 方法覆盖管理生成器列表标题?
我花了几个小时寻找生成器配置中的 list.title 变量以及如何覆盖它。
任何想法将不胜感激!
提前致谢
I'd like to add the list of filters in the title of my executeIndex method. Does anyone know if it's possible to override the admin generator list title from the executeIndex method?
I've been searching for hours to find the list.title variable in the generator config and how to override it.
Any ideas would be appreciated!
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过覆盖生成器用来呈现 newSuccess.php 模板的模板?它可以很容易地位于缓存目录下。
提示:cache/app_name/env/module/template/ 是管理生成器生成的所有模板。
如果您在模块/模板文件夹中复制所需的文件,它应该覆盖缓存的文件
Have you tried overwritting the template the generators uses to render the newSuccess.php template? It could be easily located under the cache directory.
hint: cache/app_name/env/module/template/ there are all the temaptles generated by the admin-generator.
If you copy the one you need in your module/template folder, it should overwrite the cached one
您需要重写 GeneratorConfiguraiton 类中的 getListTitle() 方法,该方法可以在
以下位置找到:
...然后清除缓存;)
注意:如果您尝试进行一些动态标题生成,除非有是清除缓存,因此覆盖模板最终可能是您的最佳选择。
You need to override the getListTitle() method in your GeneratorConfiguraiton class which would be be found at
like:
...then clear your cache ;)
NOTE: if you're trying to do some dynamic title generation it will not carry over unless there is a cache clear, so overriding the template may ultimately be your best option.