Wednesday, 15 January 2014

templates - Dust PHP tries to call functions if a function name is passed in context -



templates - Dust PHP tries to call functions if a function name is passed in context -

i'm using php fork of dustjs: http://cretz.github.io/dust-php/

the next code works fine:

$compiled = $dust->compile('hi {name}.'); echo $dust->rendertemplate($compiled, ['name' => 'john doe']);

but next fails:

echo $dust->rendertemplate($compiled, ['name' => 'link']);

with error:

php warning: link() expects parameter 1 valid path, object given in /var/www/grallo2/vendor/dust-php/dust-php/src/dust/evaluate/evaluator.php on line 342

it seems dust trying execute php functions. there way avoid this?

php templates dust.js

No comments:

Post a Comment