Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下内容在操作中设置一个插槽,但我无法在布局中检索它。
$this->getResponse()->setSlot('global_message', 'You have already completed this contest.');
但是如果你在模板文件中设置它,它就可以正常工作。
有人对此有任何想法吗?
它应该工作。请提供一些关于您的控制器、视图和布局的代码。