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 */
#2

[eluser]InsiteFX[/eluser]
Look at the spelling of your Constructor!
#3

[eluser]Unknown[/eluser]
thank you very much




Theme © iAndrew 2016 - Forum software by © MyBB