- Notifications
You must be signed in to change notification settings - Fork439
Mustache.php v3.x drops support for PHP 5.2–5.5, but is otherwise backwards compatible with v2.x.
To ease the transition, previous behavior can be preserved via configuration:
- The
strict_callablesconfig option now defaults totrue. Lambda sections should use closures or callable objects. To continue supporting array-style callables for lambda sections (e.g.[$this, 'foo']), setstrict_callablestofalse. - A context shadowing bug from v2.x has been fixed, but if you depend on the previous buggy behavior you can preserve it via the
buggy_property_shadowingconfig option. - By default the return value of higher-order sections that are rendered via the lambda helper will no longer be double-rendered. To preserve the previous behavior, set
double_render_lambdastotrue.This is not recommended.
Note
In order to maintain a wide PHP version support range, there are minor changes to a few interfaces, which you might need to handle if you extend Mustache (seec0453be).
New
\Mustache_Engineand other prefixed classnames are all available as\Mustache\Engine, etc. You can keep using the old style for now, if you feel nostalgic for 2008, but you'll want to update eventually.- Adds support for the Mustachedynamic tag names spec for partials and interpolation.
Improved
- The
{{% BLOCKS }}pragma is now part of the Mustache spec, and is enabled by default. - Optional Mustache specs (
lambdas,inheritance, anddynamic_names) can now be disabled via config options. - No more warnings or errors in PHP 8.x (thanks@reedy,@swissspidy, and everyone else who helped with this!).
- Improved resolution of complicated combinations of filters, dotted name lookups, and lambdas.
- Remove autoloader implementation. Just use Composer.
Assets2
Uh oh!
There was an error while loading.Please reload this page.
3 people reacted