php - How to pass variables from controller to view in CodeIgniter 3
Get the solution ↓↓↓Solution:
Place your all views inside www\Project_folder\application\views path. Then you can pass variables like easily.
$data['title'] = "dashboard";
$this->load->view('header', $data);
$this->load->view('home');
$this->load->view('footer');
No need to pass $data variable to both header and home views. You can pass it to header only.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot access offset of type string on string
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.