在action中定义变量
// in the action
class ...Actions extends sfActions
{
public function execute...()
{
$this->title = 'foo';
}
}
在template取得变量,再传给layout
// in the template
<?php slot('title', $title) ?>
在layout中,显示变量
// in the layout
<?php echo get_slot('title') ?>
2009-02-25
在layout中应用action定义的变量
2 条评论 »
这篇文章上的评论 RSS feed TrackBack URL
领教,谢谢
Comment 由 leo — 2009-03-20 @ 00:49
eGmiuweus [url=http://tiny.cc/getafreeiphone]Free iPhone 5[/url] Illeonnychjbg
Comment 由 Ceabfloalge — 2011-11-19 @ 08:11