HMVC and Layout Template Library - 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: HMVC and Layout Template Library (/showthread.php?tid=20119) |
HMVC and Layout Template Library - El Forum - 06-29-2009 [eluser]Mark75[/eluser] Hi, i'm trying to get Jérôme Jaglales Template Library (http://maestric.com/en/doc/php/codeigniter_template) running along with HMVC. This is the library: Code: class Template { and this is a part from my folder structure: Code: application When i try to load Code: $this->template->load('home', 'partial', $this->data); How can i make it include the partial view from my module-view folder? Any help is greatly appreciated. Cheers, Mark HMVC and Layout Template Library - El Forum - 06-30-2009 [eluser]Jérôme Jaglale[/eluser] In libraries/Template.php add: Code: function load_partial($template = '', $view = '' , $view_data = array(), $return = FALSE) In the controller: Code: $this->template->set('controller', $this); Details: if I've understood correctly, HMVC makes the controller use a custom load->view() method, but without overriding load->view() from $this->CI. To make the Template library use the load->view() from HMVC we pass the controller and call load->view() on it. HMVC and Layout Template Library - El Forum - 07-01-2009 [eluser]Mark75[/eluser] Hi Jérôme, thanks for your fast answer. This works perfectly for me! Regards Mark HMVC and Layout Template Library - El Forum - 07-11-2009 [eluser]Flak[/eluser] Seems logically, but cannot get object, view() is not loaded. Message: Trying to get property of non-object Filename: libraries/Template.php Line Number: 20 Its not getting instance. Call to a member function view() on a non-object on line 20 HMVC and Layout Template Library - El Forum - 07-11-2009 [eluser]Flak[/eluser] I think I got it. HMVC and Layout Template Library - El Forum - 07-18-2009 [eluser]kakap[/eluser] hi,it's very nice library,thanks for it I wanna aks, what if I put my template outside CI's system direktori?? how to make it? my case was: I've got template from internet,then extract it to folder 'light' under folder 'templates' my file structure was like this: |system <folder> |application <folder> |templates <folder> |light <folder> |images <folder> |style.css<file> |header.php <file> |body.php |footer.php |user_guide <folder> how to use your library to my template? Help me Please, Thank you HMVC and Layout Template Library - El Forum - 07-18-2009 [eluser]wiredesignz[/eluser] [quote author="kakap" date="1247931126"]...how to use your library to my template?[/quote] Tell the library to use a relative path, such as: Code: $this->load->view('../../templates/header', $data); HMVC and Layout Template Library - El Forum - 07-20-2009 [eluser]kakap[/eluser] [quote author="wiredesignz" date="1247934809"][quote author="kakap" date="1247931126"]...how to use your library to my template?[/quote] Tell the library to use a relative path, such as: Code: $this->load->view('../../templates/header', $data); thank you but,I mean how to use this template library http://maestric.com/wiki/lib/exe/fetch.php?id=&cache=cache&media=php:ci_template_library3.zip) where my template folder is in outside of system directory ? "How you usually load a view: $this->load->view('about', $data); How you load a view into a template with this library: $this->template->load('template', 'about', $data); That loads the view about.php into template.php." that's I take example from the site http://maestric.com/doc/php/codeigniter_template Any body, I expect your help,Tq HMVC and Layout Template Library - El Forum - 07-17-2010 [eluser]tahsin352[/eluser] Hello, Here comes a new layout library with new features for using any number of html blocks in the layout. check it out <a href="http://newdailyblog.blogspot.com/2010/07/codeigniter-advanced-layout-library.html">http://newdailyblog.blogspot.com/2010/07/codeigniter-advanced-layout-library.html</a>. You can also use it in hmvc modular form. HMVC and Layout Template Library - El Forum - 06-10-2012 [eluser]TomTom[/eluser] [quote author="Jérôme Jaglale" date="1246405206"]In libraries/Template.php add: Code: function load_partial($template = '', $view = '' , $view_data = array(), $return = FALSE) In the controller: Code: $this->template->set('controller', $this); This isn't working for me. My folders' structure is this: Code: root I've added the required code to Template.php and this code to index method in my frontend.php: Code: $this->template->set('controller', $this); When I load the Frontend's index method, I get the error message: Quote:Unable to load the requested file: menu.php |