Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Config a default parser and get rid of the extension all the time
  • I want to use the mustache parser for my views but i don't want to have to type the whole extensions in the
    View::forge('index.mustache', $data);
    
    function. How would i be able to just have something like
    View::forge('index', $data);
    
  • Ok, i dropped mustache already as there is no way of using
    HTML::input();
    
  • I don't think you can't. The parser package will install an extension of the View class. It's forge() method uses the extension to lookup the template parser that needs to be used. These are configured in the parser.php config file in the package. If no extension matches ( and that is the case with "no extension" ), the default View class is used. You can copy the parser config file to app/config, and see what happens if you change the mustache extension to "" (empty string), but I doubt it will happen. You could shorten the extension to ".m" for example, that works.
  • Harro Verton wrote on Tuesday 11th of September 2012:
    I don't think you can't. The parser package will install an extension of the View class. It's forge() method uses the extension to lookup the template parser that needs to be used. These are configured in the parser.php config file in the package. If no extension matches ( and that is the case with "no extension" ), the default View class is used. You can copy the parser config file to app/config, and see what happens if you change the mustache extension to "" (empty string), but I doubt it will happen. You could shorten the extension to ".m" for example, that works.

    Thanks, i already thought of that but was hoping for a clean 'no extension' way. Anyway, also for performance reasons i would rather stick with plain php.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion