fuel / parser

Fuel PHP Framework - v1.x template parser package adapters
http://fuelphp.com
64 stars 45 forks source link

Use Composer for Parser dependencies, update Mustache. #62

Closed bobthecow closed 11 years ago

bobthecow commented 11 years ago

Fixes #61

bobthecow commented 11 years ago

There are arguably more interesting things that could happen here, but I'm a huge proponent of Minimum Viable Pull Requests so we'll leave this one at this.

  1. Mustache supports partials which are very alsome. This currently supports passing partials as strings (the super-naive way of doing it)... a better approach would be to use a filesystem loader from a predefined partials directory config. An even better approach would be to make a Finder Loader specifically for Fuel which delegates to Finder::search so you could use namespaced views, or views provided by packages, or whatever, essentially the same search mechanism as View::forge uses. I think that's probably best done in another pull request though.
  2. Mustache supports PSR-3-compatible logging. It looks like there's currently a bridge for Monolog, but passing the unbridged version to the Mustache_Engine constructor as a logger option would make it Just Work, which would be pretty rad too.
  3. Because escaping in Mustache is handled at the template level ({{ tag }} vs {{{ tag }}}) something should probably be done about get_data what with all it's $filter_local business. I'm not entirely sure what should happen there, but this almost guarantees that things are getting double-escaped, and nobody likes > in their output :P
bobthecow commented 11 years ago

Thank you :)