gamesstart 发表于 2011-8-12 16:56:12

CI 可以修改VIew 的路径么

我想把 app 下的view 移到项目的根目录下 并修改文件价名称为 templets

saturn 发表于 2011-8-12 17:54:15

可以,拓展下Loader即可(system/core/Loader.php)。拓展方法参考手册。默认情况下,在Loader的解析函数里面定义了views的路径:

/**
         * Constructor
         *
         * Sets the path to the view files and gets the initial output buffering level
         *
         * @access      public
         */
      function __construct()
      {
                $this->_ci_view_path = APPPATH.'views/';
                $this->_ci_ob_level= ob_get_level();
                $this->_ci_library_paths = array(APPPATH, BASEPATH);
                $this->_ci_helper_paths = array(APPPATH, BASEPATH);
                $this->_ci_model_paths = array(APPPATH);

                log_message('debug', "Loader Class Initialized");
      }


要善于查看代码。
页: [1]
查看完整版本: CI 可以修改VIew 的路径么