![]() |
[SOLVED] HMVC current module path - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: [SOLVED] HMVC current module path (/showthread.php?tid=40108) |
[SOLVED] HMVC current module path - El Forum - 03-30-2011 [eluser]Davide Bellini[/eluser] Hi guys! I'm integrating Twig Template library in CI with HMVC. I want insert html template page in module/views folder, like this : - module_name - controllers - module.php - models - module_model.php - views - module_view.html - module_view1.html - ... How can I retrieve current module "views" path?? I've to set this path in Twig_Loader_Filesystem(array("MODULE_VIEWS_PATH")); Cheers UPDATE : I found a solution for my problem ... I've used : Code: $module_info = Modules::find($view_name, $this->router->class, 'views/'); and retrieve : Code: array( Hope this is helpful [SOLVED] HMVC current module path - El Forum - 04-04-2012 [eluser]Unknown[/eluser] Hi, Thank you, your solution is good and is a good start point. Unfortunately, It's not at all good for me because i need inherit from a base template in all my templates. I use the CodeIgniter Twig Integration Library (altrano) My solution was as follows: - In the config file application/config/twig.php: Code: $config['template_dir'] = APPPATH.'views'; //For global Templates - In the library application/libraries/Twig.php: Code: Twig_Autoloader::register(); Hope this is helpful too for someone [SOLVED] HMVC current module path - El Forum - 06-01-2013 [eluser]Unknown[/eluser] Thank you joseayram, I changed this line to give me access to the "Contexts" in CIBonfire - https://github.com/ci-bonfire/Bonfire/wiki/Contexts Code: $template_module_dir = APPPATH.'modules/'.$this->CI->router->fetch_module().'/views/'.$this->CI->router->fetch_class(); I used - https://github.com/dilantha/codeigniter-twig |