用户
 找回密码
 入住 CI 中国社区
搜索
查看: 4140|回复: 1
收起左侧

[讨论/交流] CI 可以修改VIew 的路径么

[复制链接]
发表于 2011-8-12 16:56:12 | 显示全部楼层 |阅读模式
我想把 app 下的view 移到项目的根目录下 并修改文件价名称为 templets
发表于 2011-8-12 17:54:15 | 显示全部楼层
可以,拓展下Loader即可(system/core/Loader.php)。拓展方法参考手册。默认情况下,在Loader的解析函数里面定义了views的路径:

PHP复制代码
  /**
         * 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");
        }
 
复制代码


要善于查看代码。

本版积分规则