Why is this constructor failing to load in Code Igniter?

前端 未结 1 1790
情书的邮戳
情书的邮戳 2021-02-08 12:11

I\'m trying to create a constructor in Code

相关标签:
1条回答
  • 2021-02-08 12:37

    It should be this...

    <?php
    class Blog extends CI_Controller {
    
        function __construct() {
            parent::__construct();
        }
    
    }
    

    The tutorial you are probably going through is based on 1.7.2 which had a core of php4 which did not use the php5 __construct() method of building Class constructors. Codeigniter 2.0.0 has a php5 core and uses it.

    0 讨论(0)
提交回复
热议问题