ric*_*age 15
使用插槽.
在你的行动方法中:
$this->getResponse()->setSlot("foo", "12345");
Run Code Online (Sandbox Code Playgroud)
在您的布局模板中:
<?php echo get_slot("foo", "default value if slot doesn't exist"); ?>
Run Code Online (Sandbox Code Playgroud)
这将输出插槽内容.在此示例中,您将看到12345显示在布局中.如果未在操作中设置插槽的值,则可以提供要在布局中显示的默认值.
| 归档时间: |
|
| 查看次数: |
5419 次 |
| 最近记录: |