Closed billmn closed 13 years ago
That might be a misunderstanding of what 'extension' does (and maybe the wrong choice of variable name).
If you define .html as extension, it means that
$view = \View::forge('page.html');
will use the Twig parser. It is the extension used in the forge() call, not the extension of the file on disk, which is always equal to the one used in the call.
No... if you specify an extension into an array ( in parser config file ) you can set a different extension for the forge() method and the view.
You can see an example in Parser Github documentation that using Dwoo :
// load a Dwoo template, ATTENTION: this one expects app/views/example.tpl View::forge('example.dwoo');
ah, I missed that one. In that case, let's call this a bug... ;)
With a configuration like :
I expect that I can use Twig template page with ".html" extension so :
But parser always search a 'page.twig' page and and if it doesn't exist I obatin a "view not found" error.
I think that the error can be in "parser\classes\view.php" in line 82 :
When View class set the page extension ( .html ), the parser class has already searched and parsed the page with '.twig' extension