Symfony 管理生成器标题覆盖

发布于 2024-10-01 11:27:52 字数 154 浏览 3 评论 0原文

我想在我的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

粉红×色少女 2024-10-08 11:27:52

您是否尝试过覆盖生成器用来呈现 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

如梦亦如幻 2024-10-08 11:27:52

您需要重写 GeneratorConfiguraiton 类中的 getListTitle() 方法,该方法可以在

/apps/[admin_app]/modules/[module_name]/lib/[module_name]GeneratorConfiguration.class.php

以下位置找到:

public function getListTitle()
{
    return 'Your new list title';
}

...然后清除缓存;)

注意:如果您尝试进行一些动态标题生成,除非有是清除缓存,因此覆盖模板最终可能是您的最佳选择。

You need to override the getListTitle() method in your GeneratorConfiguraiton class which would be be found at

/apps/[admin_app]/modules/[module_name]/lib/[module_name]GeneratorConfiguration.class.php

like:

public function getListTitle()
{
    return 'Your new list title';
}

...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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文