How can I reuse data passed from controller in a view ?
controller’s function
public function display()
{
$data=ReadIntoDate();
$this->load->view('display',$data);
}
I would like to use $data in display.php in view. Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should pass an associative array.
So if you do it like this:
You can call the data in the view like:
Hope it helped.