码迷,mamicode.com
首页 > 其他好文 > 详细

yii调用外部action与在外部action中渲染页面

时间:2014-07-09 17:26:21      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:问题   cti   io   app   ar   re   

// 1. 在controller中映射action
public function actions()
{
return array(
‘create‘ => ‘application.controllers.miiuser.CreateAction‘,
);
}

// 2. 在action中run方法中写逻辑,但下面的render方法显示不行,因为CAction类没有render方法
class CreateAction extends CAction {
public function run(){
// 逻辑处理省略
$this->render(‘worktime.php‘, $data);
}
}

// 3. 别急,CAction 类中有getController方法,问题解决
class CreateAction extends CAction {
public function run(){
// 逻辑处理省略
$this->getController()->render(‘worktime.php‘, $data);
}
}

yii调用外部action与在外部action中渲染页面,布布扣,bubuko.com

yii调用外部action与在外部action中渲染页面

标签:问题   cti   io   app   ar   re   

原文地址:http://www.cnblogs.com/mazefeng/p/3831978.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!