Passing data from controller to menu |
hisorry for english , if i want pass data from controller to menu can i use this :
PHP Code: <?= $this->include('templates/head') ?> Or must i echo the view in controller ?like this: PHP Code: echo view('templates/header_client',$data );
The second one looks much better. But just send only one $data. You can do it on header. If this header is for all pages, then you will not have any problem.
PHP Code: echo view('templates/header_client',$data );
What I do for the data is create a dummy view file that is empty called view_data.php
PHP Code: $data = [ Then all I have to do is load the view_data first and all views get the data. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |