Feature request: config leaveEmpty

4 views
Skip to first unread message

93-interactive

unread,
Feb 23, 2011, 12:35:39 PM2/23/11
to H2o template PHP
Hi,

for my current problematic (see discussion here) there would be a easy
solution:

a new config variable, maybe 'leaveEmpty' or similar which defaults to
false and when set to true, after rendering the template, all variable
place holders like are still there.

E.g.: Template index.html:

Hello {{ user }} your password is {{ password }}

Default:

$h2o = new h2o('index.html');
$vars = array('user' => 'John Doe');
echo $h2o->render($vars);

gets:

Hello John Doe your password is

Optional behaviour:

$h2o = new h2o('index.html', array('leaveEmpty'=>true);
$vars = array('user' => 'John Doe');
echo $h2o->render($vars);

gets:

Hello John Doe your password is {{ password }}
Reply all
Reply to author
Forward
0 new messages