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

[eluser]Colin Williams[/eluser]
The current working version of Template is all over the place, so there are many updates that are yet untested. I might do some sort of beta release soon, Template 1.5b.

In the meantime, try this patch:

Step 1, add this method to the Template class:

Code:
/**
     * Check for the existance of a view
     *
     * @access    private
     * @param    string    path to view file
     * @return    bool    TRUE if file found, else FALSE
     */
  
   function _view_exists($view)
   {
       $mod_dir = 'modules/'. $this->CI->uri->rsegment(1) .'/';
       return (
           (file_exists(APPPATH .'views/'. $view . EXT) or file_exists(APPPATH .'views/'. $view))
           or
           (file_exists(APPPATH . $mod_dir .'views/'. $view . EXT) or file_exists(APPPATH . $mod_dir .'views/'. $view))
         );
   }

Step 2, replace lines 364-369 AND lines 406-411 with this code:

Code:
if ($this->_view_exists($suggestion))
{
   // Just change the $view arg so the rest of our method works as normal
   $view = $suggestion;
   break;
}

Lastly, change line 108 to

Code:
if ($this->_view_exists($filename))

Essentially, you are replacing all file_exists() checks with the "ME-HMVC aware" _view_exists() method. I must stress that this is highly untested and my knowledge of the Modular Extensions, er, extension is limited.

If you just want the latest-and-greatest version of the whole class, PM me.


Messages In This Thread
Template Library and HMVC - by El Forum - 01-01-2009, 01:48 AM
Template Library and HMVC - by El Forum - 01-01-2009, 03:11 AM
Template Library and HMVC - by El Forum - 07-11-2009, 11:35 AM
Template Library and HMVC - by El Forum - 07-11-2009, 06:30 PM
Template Library and HMVC - by El Forum - 08-22-2009, 11:38 PM
Template Library and HMVC - by El Forum - 08-23-2009, 02:04 AM
Template Library and HMVC - by El Forum - 10-30-2009, 05:47 PM
Template Library and HMVC - by El Forum - 10-30-2009, 06:23 PM
Template Library and HMVC - by El Forum - 10-30-2009, 06:53 PM
Template Library and HMVC - by El Forum - 10-30-2009, 07:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB