php-mustache icon indicating copy to clipboard operation
php-mustache copied to clipboard

Loading a template from the filesystem with partials resolution: an example.

Open gjcarrette opened this issue 2 years ago • 0 comments

This mustache implementation is fast, well known, stable, and extensively used in some big applications.

Questions such those raised in issues https://github.com/jbboehr/php-mustache/issues/45 and https://github.com/jbboehr/php-mustache/issues/4 suggest that examples of template loading, AST walking, and partials resolution would be helpful. In the spirit of php.net documentation I have just added an examples section to the end of the README.md and provided an example covering all 3 topics.

The Mustache_Template_Loader class is extracted from production code. The implementation of the resolve_partials function does suggest that it would be nice to expose as constants in the MustacheAST class the type enum from https://github.com/jbboehr/libmustache/blob/master/src/node.hpp

gjcarrette avatar Jul 11 '22 02:07 gjcarrette