Skip to content

Commit

Permalink
Improve compatibility with HMVC approach. You don't have to create fo…
Browse files Browse the repository at this point in the history
…lders to views/templates for all your modules.
  • Loading branch information
elrafael committed Nov 7, 2012
1 parent be56859 commit bf4c7f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libraries/Twiggy.php
Expand Up @@ -469,7 +469,11 @@ private function _set_template_locations($theme)

foreach($module_locations as $loc => $offset)
{
$this->_template_locations[] = $loc . $this->_module . '/' . $this->_config['themes_base_dir'] . $theme;
/* Only add the template location if the same exists, otherwise
you'll need always a directory for your templates, even your module
won't use templates */
if ( is_dir($loc . $this->_module . '/' . $this->_config['themes_base_dir'] . $theme) )
$this->_template_locations[] = $loc . $this->_module . '/' . $this->_config['themes_base_dir'] . $theme;
}
}
}
Expand Down

0 comments on commit bf4c7f7

Please sign in to comment.