Closed billmn closed 13 years ago
Already possible as @Wanwizard pointed out using the parser method.
Either request it on a specific driver class or on a view object:
View_Smarty::parser();
$view->parser();
No ... if you make a static call in a controller like \Parser\View_Smarty::parser() ( is the same for twig and other drivers ) you haven't execute a View::factory() method and template library class isn't included.
We can add a "include_once" on a _init() function on every driver class, like
public static function _init() { include_once \Config::get('parser.View_Smarty.include'); } ...
I've just prepared all drivers with this method ... if you agree I can send a pull request
Adding the inclusion to _init() is a good idea, I would prefer it to still support multiple files even though we know the number of files per driver. That keeps the code nice and consistent:
// Include necessary files
foreach ((array) \Config::get('parser.'.$class.'.include', array()) as $include)
{
require_once $include;
}
Ok Jelmer! In _init() we also have to add a parent::_init() to not override auto_encode config check.
Look at : http://www.fuelphp.com/forums/topics/view/4059