2011-04-18 81 views
0

我想返回一个视图,但Kohana强制它通过默认视图,我不想要。我如何临时禁用默认视图?绕过默认视图,Kohana

+0

什么“默认视图”?你在谈论模板控制器吗? – zombor 2011-04-18 17:21:18

回答

1

由于zombor评论,如果你真的在谈论模板控制器,你可以把这个线在你的控制器禁用其渲染:

$this->auto_render = FALSE; 
0
public function action_index() 
    { 
     $user_view = $this->getUserView(); 

     $this->request->response = View::factory('templates/main',$user_view); 
    } 
public function getUserView($user_details) 
    { 
     $user_view['list_page'] = View::factory('templates/usermgt') 
         ->bind('user_detail','data') 
         ->bind('msg','test'); 
     return $user_view; 
    } 

其中getUserView()返回视图页面,行动指数。 希望它符合我们的要求