Welcome Guest, Not a member yet? Register   Sign In
HMVC and Layout Template Library
#1

[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 {
    var $template_data = array();

    function set($name, $value)
    {
        $this->template_data[$name] = $value;
    }

    function load($template = '', $view = '' , $view_data = array(), $return = FALSE)
    {
        $this->CI =& get_instance();
        $this->set('content', $this->CI->load->view($view, $view_data, TRUE));
        return $this->CI->load->view($template, $this->template_data, $return);
    }

}

and this is a part from my folder structure:
Code:
application
- modules
    -front
      - views
         - partial.php
- views
    - home.php

When i try to load
Code:
$this->template->load('home', 'partial', $this->data);
from my controller, the 'partial'-view is not found, because the library only looks in the global view folder.
How can i make it include the partial view from my module-view folder?

Any help is greatly appreciated.

Cheers,
Mark


Messages In This Thread
HMVC and Layout Template Library - by El Forum - 06-29-2009, 05:37 AM
HMVC and Layout Template Library - by El Forum - 06-30-2009, 04:40 PM
HMVC and Layout Template Library - by El Forum - 07-01-2009, 04:28 AM
HMVC and Layout Template Library - by El Forum - 07-11-2009, 10:14 AM
HMVC and Layout Template Library - by El Forum - 07-11-2009, 10:16 AM
HMVC and Layout Template Library - by El Forum - 07-18-2009, 04:32 AM
HMVC and Layout Template Library - by El Forum - 07-18-2009, 05:33 AM
HMVC and Layout Template Library - by El Forum - 07-20-2009, 08:34 PM
HMVC and Layout Template Library - by El Forum - 07-17-2010, 03:12 AM
HMVC and Layout Template Library - by El Forum - 06-10-2012, 02:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB