ashiyouwu 发表于 2014-4-3 23:26:27

CI 按书上写的第一个程序就有问题

就是 那本经典的书 第一个例子welcome to this site 那个 但是 一直有问题 我觉得可能是 那个书版本太旧跟最新的CI 可能有点问题 我刚接触 也不大懂

ashiyouwu 发表于 2014-4-8 21:57:58

ljc 发表于 2014-4-8 16:40
看看基础语法吧,类都有构造方法的。。

file:///C:\Users\Roy\AppData\Roaming\Tencent\Users\378397243\QQ\WinTemp\RichOle\HX{1L[}WU{_YIIK(P.jpgfile:///C:\Users\Roy\AppData\Roaming\Tencent\Users\378397243\QQ\WinTemp\RichOle\HX{1L[}WU{_YIIK(P.jpgfile:///C:\Users\Roy\AppData\Roaming\Tencent\Users\378397243\QQ\WinTemp\RichOle\HX{1L[}WU{_YIIK(P.jpg378397243这样写对吗可还是有问题 404 求解啊

ljc 发表于 2014-4-11 11:59:44

ashiyouwu 发表于 2014-4-8 21:57
这样写对吗可还是有问题 404 求解啊

function __construct()
    {
      parent::__construct();
      $this->base=base_url();
      $this->css=$this->config->item('css');
    }

这样写

weiryang 发表于 2014-4-22 16:07:35

最新的应该这样写
class Project extends CI_Controller{
        public function Project()
        {
                parent::__construct();

zangyuyang 发表于 2014-4-4 19:15:36

构造函数错了,你用的是老的,
function __construct()
    {
      parent::__construct();
}

zangyuyang 发表于 2014-4-4 19:16:26

$this->load-config();

ashiyouwu 发表于 2014-4-4 20:08:54

zangyuyang 发表于 2014-4-4 19:15
构造函数错了,你用的是老的,
function __construct()
    {


什么意思?Start 函数 有错吗?

ashiyouwu 发表于 2014-4-4 20:09:19

zangyuyang 发表于 2014-4-4 19:16
$this->load-config();

要把 item 改成 load?

ljc 发表于 2014-4-7 13:37:59

function __construct()
{
        parent::__construct();
}
这样写构造函数

ashiyouwu 发表于 2014-4-8 15:54:51

ljc 发表于 2014-4-7 13:37
function __construct()
{
        parent::__construct();


不太懂, 你可以具体帮我把那个程序改一下吗 现在刚入门

ljc 发表于 2014-4-8 16:40:47

ashiyouwu 发表于 2014-4-8 15:54
不太懂, 你可以具体帮我把那个程序改一下吗 现在刚入门

看看基础语法吧,类都有构造方法的。。
页: [1] 2
查看完整版本: CI 按书上写的第一个程序就有问题