[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 <?=$view?> and problem is unknow view.
if I change
function __construct() into
function Navigation() it got another problem. I'm beginner in PHP