Welcome Guest, Not a member yet? Register   Sign In
Help about load Library
#3

[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


Messages In This Thread
Help about load Library - by El Forum - 01-03-2008, 05:02 AM
Help about load Library - by El Forum - 01-03-2008, 07:52 PM
Help about load Library - by El Forum - 01-03-2008, 09:39 PM
Help about load Library - by El Forum - 01-03-2008, 09:48 PM
Help about load Library - by El Forum - 01-03-2008, 10:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB