[SOLVED] HMVC current module path |
[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
[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
[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 |
Welcome Guest, Not a member yet? Register Sign In |