Hello, I have a question about how to call partial files using the Handlebars parser.
In my example I have this 2 templates (which are in different folders): "views/auth/mainview.html" and "views/auth/myfolder/mypartial.html"
With Mustache I managed to make it work by doing this way:
\Parser\View_Mustache::parser() ->setPartialsLoader( new Mustache_Loader_FilesystemLoader( APPPATH.'views', array('extension' => '.html') ) );
Then I forge my view by doing this View::forge('auth/mainview.mustache', $data, false);
in "mainview.html" I display my partial file by doing this: {{> auth/myfolder/mypartial}}
With Handlebars, I've got some difficulties. I did like this: View::forge('auth/mainview.handlebars', $data, false);
in "mainview.html" I display my partial file by doing this: {{> auth/myfolder/mypartial}}
=> The "bug" I have is that the called partial return the path of the partial: "/Users/gwen/Documents/www/myproject/fuel/app/views/auth/myfolder/mypartial.html" Instead of its content!
My question is, how to handle partials with Handlebars within fuelphp?
For Mustache you need to configure the "partials_loader" option in the config with the path(s) you want to pass, you don't need to modify code or set your own partial loader.
For Handlebars I've pushed an fix to return the file contents instead of the file name. I misinterpreted the functionality of the partial loader.
However I have got a new error: The content of the partial is displayed "before" the main view and the params given are not interpreted in the partial view.
mainview.html: <h1>My main view</h1> {{> auth/myfolder/partialbasic}}