Welcome Guest, Not a member yet? Register   Sign In
Default header and footer with loading a view
#11

[eluser]MEM[/eluser]
[quote author="adamp1" date="1245873597"][quote author="Iverson" date="1245350722"][quote author="Dark Preacher" date="1245105678"]I'm doing it like this:
in views folder file named "template.php"
Code:
$this->load->view('_header');
$this->load->view('_left');
$this->load->view($main);
$this->load->view('_footer');

and in controller
Code:
$data['main'] = 'catalog_root';
$this->load->view('template', $data);

Pretty simple, no hacks to the core and easy to use.[/quote]

+1[/quote]
+1, this the simplest and best tbh[/quote]


A better way would be to have the CI core files on a private folder, and the public files such as templates, assets and the router, on the public folder. More secure I believe, no?

Regards,
Márcio




Theme © iAndrew 2016 - Forum software by © MyBB