[eluser]ann91[/eluser]
hello guys, i have problem about this code. i use codeigniter 2.0.2. In this case, i want to make template with class Template Parser.
Code:
function index()
{
$data = array( 'title' => 'Welcome to my webSite',
'content' => 'This is the Content'
);
$this->parser->parse('main', $data);
}
and the function Model
Code:
function getRecentPost()
{
$this->db->select('*');
$this->db->from('post p');
$this->db->where('active_post',1); //
$this->db->order_by('p.post_id','desc');
$this->db->limit(5); //
return $this->db->get();
}
if i want to add <b>Postmodel</b> into <b>content</b> pseudo-variables, how i write it??
in codeigniter 1.7.2, the code like this..
Code:
function index()
{
$data['title']="Welcome to My Website"; //
$data['content']=$this->postmodel->getRecentPost(); //
$this->load->view('main',$data);
}