89007342 发表于 2010-8-23 16:40:23

为什么总提示 The requested view 1 could not be found

我的controller:
class Controller_Test extends Controller{
       
        //public $template = 'site';
        public function action_index(){
                $view = new View('site');
                $view->render(TRUE);
        }

我的view就显示了几个英文字每 ,为什么提示这样的错误呀

$this->request->response = $view->render();
这样就能显示,到底是怎么回事啊?

icyleaf 发表于 2010-8-26 11:27:54

在 KO3 中不提倡使用 new 实例化对象,尽量使用 factory。
class Controller_Test extends Controller{
      
      //public $template = 'site';
      public function action_index(){
                $this->request->response = View::factory('site');
      }
页: [1]
查看完整版本: 为什么总提示 The requested view 1 could not be found