![]() |
File checking - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: File checking (/showthread.php?tid=65611) |
File checking - wolfgang1983 - 07-01-2016 In my view folder I have a theme_view.php Which checks for multiple views etc and sets the correct theme. Is this code OK seems to work PHP Code: <?php And Controller PHP Code: <?php RE: File checking - PaulD - 07-01-2016 It looks fine to me (although I do not like to load views from views), but I would question the need for the file_exists checks, as the loader class does this anyway. You would then only need: PHP Code: $this->load->view($this->config->item('config_theme') . '/template/common/header_view'); Much cleaner! PS I would put this into a theme library, and call the views from there. The library could then be as complex as you like, coping with theme JS and CSS files for the footers and headers, or more complex theme layouts that require more than a single header and footer. For instance your blog page might need a standard blog_header and blog sidebar, or your login page might need a public_header and public_footer. You could then have a theme config file with different setups for different page styles within a theme. RE: File checking - wolfgang1983 - 07-01-2016 (07-01-2016, 04:12 AM)PaulD Wrote: It looks fine to me (although I do not like to load views from views), but I would question the need for the file_exists checks, as the loader class does this anyway. You would then only need: Thanks for ideas. |