Open bmcminn opened 9 years ago
You cannot specify extension
option at Handlebars
instance and it's a correct behavior. There are several loaders and only FilesystemLoader
one operates with files and needs an extension to load them. That's why extension
option is only specified in FilesystemLoader
constructor.
So I don't see any problems here.
I love the []
over array()
in these examples! :wink:
I traced this issue back to the
Handlebars\Loader\FilesystemLoader.php
file and noticed in thegetFileName()
method, echoing$this->_extension
shows the value is still the default".handlebars"
string instead of the shorthand I defined in my$options
argument on my Handlebars instance.https://github.com/XaminProject/handlebars.php/blob/master/src/Handlebars/Loader/FilesystemLoader.php#L190-L195
The end result is that Handlebars errors out saying it can't find my template because it isn't using the right file extension.
EDIT: Realized the config I setup wasn't being passed to the FilesystemLoader instance :p
I'm wanting to add a write up on the Fileloader config properties, so I'll see about getting a pull request going this weekend.