在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定义的变量
1 条评论 »
这篇文章上的评论 RSS feed TrackBack URL

领教,谢谢
Comment 由 leo — 2009-03-20 @ 00:49