Sunt nou in codeigniter si am nevoie de un sfat in urmatoarea problema :
Am creat o librarie noua care sa ma ajute in generarea unui meniu dinamic pentru website dupa ce am terminat codul si am incercat sa il probez am primit urmatoarea eroare "Fatal error: Call to a member function segment() on a non-object in /home/content/37/9640937/html/beclevo.com/application/libraries/menus.php on line 30"
codul arata asa :
Cod: Selectaţi tot
function __consturct(){
$this->CI = &get_instance();
$this->base_url = $this->CI->config->item('base_url');
$this->languages = $this->CI->config->item('languages');
}
iar la linia 30 am urmatoarea functie :
Cod: Selectaţi tot
function what_page(){
$segment1 = $this->CI->uri->segment(1); // linia 30
$segment2 = $this->CI->uri->segment(2);
if(!empty($segment1)){
if($this->is_language($segment1)){
// segment1 is a language
if(!empty($segment2)){
$page = $segment2;
}else{
// home
$page = 'home';
}
}else{
// segment1 is not a language
$page = $segment1;
}
}else{
$page = 'home';
}
}
mentionez ca nu este prima librarie pe care o fac pentru acest site iar pana acum nu am primit nici o eroare de acest gen .
Multumesc !