不存在的类:Template-升级到Code Igniter 3.0.0


Non-existent class: Template - Upgrade to Code Igniter 3.0.0

我正在将CodeIgniter2.2.0升级到3.0.0

上面写着

404找不到页面错误,找不到您要查找的页面,或者不可用的遇到错误

不存在类:模板

ERROR - 2015-03-31 23:02:10 --> Non-existent class: Template
ERROR - 2015-03-31 23:02:31 --> Non-existent class: Template

我在loader.php上检查过没有template.php



遇到错误

无法写入"title"区域。该区域未定义。

尝试将类名更改为Template,而不是CI_Template。还要确保更改类的构造函数。

我对库system/libraries/className.php也有同样的问题,并通过将其更改为application/libraries来解决。我想你也得这么做。

首先,您需要将类名从CI_Template更改为Template,还需要将构造函数从CI_Template更改为Template

"Template"类的路径是

root/application/librarys/Template.php

其次,去

root/application/config/template.php

并添加您自己的区域。例如:

$template['default']['template'] = 'template';
$template['default']['regions'] = array(
   'header',
   'title',
   'content',
   'footer',
);
$template['default']['parser'] = 'parser';
$template['default']['parser_method'] = 'parse';
$template['default']['parse_template'] = FALSE;

这对我很有效。