symfony:如何通过 _partial 执行操作

发布于 2024-09-26 23:54:07 字数 314 浏览 1 评论 0原文

在我的应用程序中,我有一个部分菜单(_menu.php),

我需要在整个应用程序上的菜单中访问该菜单:

$this->user = $this->getUser()->getGuardUser();
$this->unread = Doctrine::getTable('sfSocialMessageRcpt')->countUnreadMessages($this->user);

但是如何为渲染的部分创建一个操作在整个应用程序中?

谢谢

in my application, I have a menu which is a partial (_menu.php)

I need in my menu which is on the entire application, to have access to that :

$this->user = $this->getUser()->getGuardUser();
$this->unread = Doctrine::getTable('sfSocialMessageRcpt')->countUnreadMessages($this->user);

But how to create an action for my partial which is rendered in the entire application ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

浊酒尽余欢 2024-10-03 23:54:07

好吧,我用组件代替。
它解决了我的问题

ok, i used components instead.
it fixed my problem

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