Jump to content

Codeigniter Library problem


c_pattle

Recommended Posts

Sorry.  So for example if I do

 

class Homepage extends CI_Controller
{
    
    function Homepage()
    {
        parent::__construct();
        
        $this->load->library('layout');
    }
}

 

The library doesn't seem to load because I can't access any of the method in that libary.  But if I was to load the library in another function that wasn't the contoller it works fine

class Homepage extends CI_Controller {
    
    public function __construct()
    {
        parent::__construct();
        
        // Assuming layout.php or Layout.php  is located in /application/libraries/
        $this->load->library('layout');
    }

    public function index()
    {
          $whatever = $this->layout->some_method();
    }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.