Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I fetched data from model in controller . i want to display this data in view inside another view. its showing blank page. here is my code..

controller -

PHP
public function Listblog()
    {
    $listblog=$this->Login->listblog();
    $listblogwithpage=$this->load->view('list_blog',$listblog);
    $this->load->view('Welcome_message',$listblogwithpage);
    }

model -

PHP
public function listblog()
{
    $query=$this->db->get('new_employee');
    return $query->result();
}


What I have tried:

i have tried this code but showing blank page
Posted
Updated 11-Oct-18 9:39am

1 solution

// the "TRUE" argument tells it to return the content, rather than display it immediately
$data['listblog'] = $this->load->view($listblog, NULL, TRUE);
$this->load->view ('Welcome_message', $data);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900