[eluser]haythem01[/eluser]
my freind i have put like you have say to me but in the scrren i have got the content of page "pages" and not content of "news"
function News()
{
parent::Controller();
$this->table ="news";
$this->table ="pages";
$this->template['module'] ="pages";
$this->template['module'] ="news";
//$this->template['module'] ="pages";
//appel au model on la défini sous le nom page
$this->load->model('News_Model','news',true);
$this->load->model('Pages_Model','page',true);
//$this->load->model('Pages_Model','page',true);
//$this->template['navigation']=$this->page->nav();
$this->template['news_']=$this->news->news_();
}
and in the models i put:
function News_Model()
{
parent::Model();
$this->table= "news";
$this->table= "pages";
}
function get($path)
{
//$this->db->where('path',$path);
$this->db->where('active',true);
$query=$this->db->get($this->table,1);
if($query->num_rows()==1)
{
return $query->row_array();
}
else
{
//false
return false;
}
}
function nav()
{
$this->db->select('title,menu_title,path');
$this->db->where('active',true);
$this->db->orderby('menu_title');
$query=$this->db->get($this->table);
if($query->num_rows()>0)
{
return $query->result_array();
}
}
i would like to write some function of model page like the navigation(); sorry i cant' speek english very well