dde333 发表于 2011-9-10 21:24:44

学习学习

loveinlove 发表于 2011-9-17 02:30:08

本帖最后由 loveinlove 于 2011-9-17 02:30 编辑

如果是本着学习目的研究 dilicms,没必要什么都按照作者原思路进行,
jeongee的view扩展是为了让 视图 有继承特性,也许我说错了。


况且 ci的code 原来越严谨,2以后 的代码比1看起来舒服多了,当然也有少了兼容php4的原因。原本还考虑使用ko的现在基本放弃。专心使用ci

本着不修改核心代码的前提下,当然如果你想fork CI至自己的一个独立版本 那另算。


如果用2.03,要想达到dilicms原有的效果,需要如此
在application/core 新建文件 Dili_Loader.php
class Dlili_Loader extends CI_Loader
{

    public function __construct()
    {
      parent::__construct();
    }

    public function _theme_switcher( $button = 'on', $theme = 'default' , $paths = 'template/')
    {
      if($button == 'on')
      {
      $this->_ci_view_paths = array(FCPATH.$paths.$theme.'/'=> TRUE);
      }
    }
}
?>




另外,在application/core/Dili_Controller.php文件中
删除 _theme_switcher 方法,
在前后台controller类中,

$this->_theme_switcher('on',setting('site_theme'));
改为
$this->load->_theme_switcher('on',setting('site_theme'));


$this->_theme_switcher('on',setting('backend_theme'),'admincp/');
改为
$this->load->_theme_switcher('on',setting('backend_theme'),'admincp/');


如此完工,本人未测试。我没有更改视图到其他目录的习惯。
被保护的对象是可以在子类中进行覆盖修改的。

按照思路 应该百分百可行,且这也遵循了 ci的开发规则。



jeongee 发表于 2011-9-17 10:20:07

loveinlove 发表于 2011-9-17 02:30 static/image/common/back.gif
如果是本着学习目的研究 dilicms,没必要什么都按照作者原思路进行,
jeongee的view扩展是为了让 视图 有继 ...

说的对:handshake

arthurwu 发表于 2011-9-21 16:53:46

学习啦 ····:lol:lol:lol:lol

~夜行侠~ 发表于 2011-10-10 15:29:17

function _site_post()
这里我也没看懂。。。。
页: 1 [2]
查看完整版本: 最近看了下 DiliCMS 实在有几个地方没看懂````