Do not include the template name in Kostache::factory, do all template detection in __construct, fixes #22

This commit is contained in:
Woody Gilk 2011-04-02 17:06:14 -05:00
parent 2d8b2c21e9
commit d2eadd380c

View file

@ -23,9 +23,9 @@ abstract class Kohana_Kostache {
* @return Kostache * @return Kostache
* @throws Kohana_Exception if the view class does not exist * @throws Kohana_Exception if the view class does not exist
*/ */
public static function factory($template, array $partials = NULL) public static function factory($path, array $partials = NULL)
{ {
$class = 'View_'.str_replace('/', '_', $template); $class = 'View_'.str_replace('/', '_', $path);
if ( ! class_exists($class)) if ( ! class_exists($class))
{ {
@ -34,7 +34,7 @@ abstract class Kohana_Kostache {
)); ));
} }
return new $class($template, $partials); return new $class(NULL, $partials);
} }
/** /**