mustache.php: Lambdas do not support complex return types
<?php
require 'mustache.php-2.14.2/src/Mustache/Autoloader.php';
Mustache_Autoloader::register();
$m = new Mustache_Engine;
echo $m->render('Hi, {{abc.def}}', ['abc' => function () { return ['def' => 12345]; }]), "\n";
Outputs:
Hi,
But I expected:
Hi, 12345
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (19 by maintainers)
Commits related to this issue
- Fix lambda resolution in dotted names Fixes #415 — committed to bobthecow/mustache.php by bobthecow 3 years ago
- Fix lambda resolution in dotted names Fixes #415 — committed to myersmediagroup/mustache.php by vshih 3 years ago
- Fix lambda resolution in dotted names Fixes #415 — committed to myersmediagroup/mustache.php by vshih 3 years ago
- Fix lambda resolution in dotted names Fixes #415 — committed to bobthecow/mustache.php by bobthecow 3 years ago
- Fix lambda resolution in dotted names Fixes #415 — committed to bobthecow/mustache.php by bobthecow 3 years ago
Latest works for me. Looks great!
Maybe this? https://github.com/bobthecow/mustache.php/pull/416
Works great so far! I’ll continue to test.
okay ignore my big long answer. i was thinking just about the section lambda spec, not the interpolation spec. lemme poke at this and get back to you 😃