php - How can I call data (array) which is in controller transfer to view page
Get the solution ↓↓↓Solution:
do like this
In controller
$data['template'] = $this->template();
$data['voyage_info'] = $this->PortManifestModel->get_voyage()->result();
$this->load->view("port/client/manifest", $data);
In View
$template # -> have your template data
$voyage_info # -> has your model data
Answer
Solution:
There's a work around that I sometimes use, it's by creating an empty view file and then passing the data to that view.
Step 1 - Create a viewempty.php
in views folder and don't put any contents in it.
Step 2 - call the view load before your normal view loads.
$this->load->view("empty", $data);
$this->load->view("port/client/manifest", $data);
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: warning: undefined array key
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.