I want to create a default layout for whole codeigniter project. (like cakephp)
I also need to pass value from database (through controller) to default layout.
How can i do this ?
I want to create a default layout for whole codeigniter project. (like cakephp)
I also need to pass value from database (through controller) to default layout.
How can i do this ?
You can use the hooks to achieve this
post_controller - You can set vars with this.
Called immediately after your controller is fully executed.
display_override - You can override display and include your own view.
Overrides the _display() function, used to send the finalized page to the web browser at the end of system execution. This permits you to use your own display methodology. Note that you will need to reference the CI superobject with $this->CI =& get_instance() and then the finalized data will be available by calling $this->CI->output->get_output()
reference : http://codeigniter.com/user_guide/general/hooks.html