Welcome Guest, Not a member yet? Register   Sign In
Problem loading library
#1

[eluser]Unknown[/eluser]
hello,
i'm newly using codeigniter to create site.
But i'm getting some trouble when loading library. I have to load a library in my controller fucntion to make the site work, i don't understand why. I thought if i just do it in my constructor this will be available in my functions.

If somebody can help.

Thanks in advance and sorry for my english.

This is my code :
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

public function __contruct()
{
     parent::__contruct();
  
     // first time : this don't work
     // $this->load->library('layout');
  
}

// GET: /Home/index
public function index()
{
        // why here
       $this->load->library('layout');
       $this->layout->view('home/home');
}
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */


Messages In This Thread
Problem loading library - by El Forum - 03-01-2014, 11:18 AM
Problem loading library - by El Forum - 03-01-2014, 01:30 PM
Problem loading library - by El Forum - 03-01-2014, 01:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB