How do I pass raw html into volt?
I need to print {{ hello }} into my html document, how is this done, without phalcon compile it to <?php echo $hello; ?>
Thanks!
Do you mean literally print?
{literal} {{ hello }} {/literal}
It would comple it: <?php echo "{{ hello }}"; ?>
Yes, i really need to see {{ hello }}
The reason is that I use handlebars, so I can't use the tag {{ }} - Unless I make volt ignore the tag..
Doesn't {{ "{{ hello }}" }} do what you need?
{{ "{{ hello }}" }}
You can add custom function for volt https://docs.phalcon.io/en/latest/reference/volt.html
$compiler->addFunction('print', function($resolvedArgs, $exprArgs) use ($compiler) { return "print(". $compiler->expression($exprArgs[0]['expr']) .")"; });
And use it in volt:
I want to print {% print("hello") %}
Sorry for the late reply, I used Miguel Nunes answer
Thanks for all who spend their time helping me out :-)