HOWTO: handle header and footer as modules (CI/blaze) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: HOWTO: handle header and footer as modules (CI/blaze) (/showthread.php?tid=16625) |
HOWTO: handle header and footer as modules (CI/blaze) - El Forum - 03-12-2009 [eluser]TheVoid[/eluser] Hi, I'm new to this community. This is my first post. Hi all! I am working on a full restructuring of CodeIgniter/Blaze. As it is build to work for anything, CI/blaze has lots of code that i don't need. And i also symplified the directories-structure. Gz to the programmers! Great piece of codes! My question is: In my index.php file were everything starts (similar to CodeIgniter.php in the system-folder), everything works fine. All modules work fine. Website running fine. My problem is the header and the footer. I got to many php-code, db-queries, ... in those template/view files. I would like to handle the header and the footer as 2 new modules. As so; index.php would have to load first the header module, then the controller wich gets now loaded, and finally the footer controller. So, i tryed This is the original code-part: Code: if ( ! file_exists(MODPATH.$RTR->fetch_module().'/controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { This is how i thought it would work: (but i'm a beginner when it comes to classes...) Code: if ( ! file_exists(MODPATH.'overall_header/controllers/overall_header'.EXT)) { Guess it would have been too easy I get this error now: Code: Notice: Undefined property: overall_footer::$overall_header in C:\*****\libraries\loader.php on line 918 I think by saying this: Code: $CI = new $class(); And that class extends the controller class, so it loads with it everything that has been loaded/calculated before. In my trial, i do that 3 times with 3 different modules. But i don't know how to do it. Sorry for the long post. Hope someone can/wants to help me. Thanks in advance! HOWTO: handle header and footer as modules (CI/blaze) - El Forum - 03-12-2009 [eluser]TheFuzzy0ne[/eluser] HEADER and FOOTER are being loaded as models, but they don't extend the model class. HOWTO: handle header and footer as modules (CI/blaze) - El Forum - 03-12-2009 [eluser]TheVoid[/eluser] In the main template file (here looking at double_column.php) i see this for including the header and footer: Code: <?php $this->load->view(false, 'themes/bb/layout/header'); ?> Code: <?php $this->load->view(false, 'themes/bb/layout/footer'); ?> The only solution for modifying the header and footer i see, is adding php-code in the themes-header and -footer file. But i dont like that way of fixing things. Would be better if it works like the module 'page' for example. Where your functions have to be placed in the model file, and everything gets runned with its controller file + the output is set in the template file. How would you do it then in my place? Thanks for your time! HOWTO: handle header and footer as modules (CI/blaze) - El Forum - 03-12-2009 [eluser]TheFuzzy0ne[/eluser] I'm sorry but I'm not familiar with the inner-workings of blaze, as I don't use blaze. I assumed that this was your own code, so you could change what you wanted. I was simply trying to point out where I thought the problem might have been. EDIT: Oh, and welcome to the CodeIgniter forums! HOWTO: handle header and footer as modules (CI/blaze) - El Forum - 03-14-2009 [eluser]TheVoid[/eluser] Thanks Well, i know now where to look. Thanks. |