 <p>I have found the answer in the <a href="https://github.com/bobthecow/mustache.php/wiki/Mustache-Tags#lambdas">wiki of the project</a></p> <blockquote> <p>The text passed is the literal block, unrendered.</p> </blockquote> <p>But it provides a <code>Mustache_LambdaHelper</code> that can be used to render the text passed.</p> <p>So I have to add this to my <em>lambda</em> function:</p> <pre><code>$data-&gt;stars = function($label, Mustache_LambdaHelper $helper) { $aux = ""; $level = $helper-&gt;render($label); $l = intVal($level); for ($i = 0; $i &lt; $l; $i++) { $aux .= "+"; } for ($i = $l; $i &lt; 5; $i++) { $aux .= "."; } return $aux; }; </code></pre> <p>And that's all it's needed to make it works. Thanks to all readers!</p>