CodeIgniter Forums
Help about load Library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Help about load Library (/showthread.php?tid=5056)



Help about load Library - El Forum - 01-03-2008

[eluser]Đỗ Thanh Tùng[/eluser]
My site work perfectly on localhost but i got problem when i running it on host.
I have 3 file in library directory but non of them loaded.
I dont know how to fix it


Help about load Library - El Forum - 01-03-2008

[eluser]Derek Allard[/eluser]
I'm moving this into a more appropriate forum to help you get the help you need.

That said, can you give us any further information? Are you getting an error message?


Help about load Library - El Forum - 01-03-2008

[eluser]Đỗ Thanh Tùng[/eluser]
Custom library can't be load in server.
This is my Navigation library :
Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
class Navigation {
    
    var $ci;
    
    function __construct()
    {
        $this->ci =& get_instance();
        $this->ci->load->library('session');
        $this->loadCategories();
    }
    
    function loadCategories()
    {
    $template['menu'] = '<ul>';
    $query = $this->ci->db->get('loaitour');
    foreach ($query->result() as $row)
    {
        if ($row->trangthai) {//Chỉ hiển thị những Loại TOur cho phép
               $template['menu'] .= '<li><a href="'.base_url().'index.php/tour/view/' . $row->id_loaitour . '">' . $row->ten_loaitour . '</a></li>';
           }
    }
    $template['menu'] .= '</ul>';
    $this->ci->load->view('menu', $template, true);
    }

}
My View is &lt;?=$view?&gt; and problem is unknow view.
if I change function __construct() into function Navigation() it got another problem. I'm beginner in PHP


Help about load Library - El Forum - 01-03-2008

[eluser]Đỗ Thanh Tùng[/eluser]
Sorry. My library cant work with __construct. It only work with Navigation()


Help about load Library - El Forum - 01-03-2008

[eluser]Đỗ Thanh Tùng[/eluser]
I fixed it. Thanks for help.