XaminProject / handlebars.php

Handlebars processor for php
331 stars 132 forks source link

How to not proccess (escape) markup? #149

Closed jcubic closed 8 years ago

jcubic commented 8 years ago

Is it possible to stop processing of handlerbars markup for a moment? something like:

{{#escape}}
<script type="type/x-handlebars">
{{#each user in controller}}
   {{user.name}}
{{/each}}
</script>
{{/escape}}

and have javascript handlebars and not php one. if not is it possible to create a helper that will do this?

everplays commented 8 years ago

Have you tried just returning the raw text from your escape helper as SafeString? It should do the job. I am not 100% sure though.

jcubic commented 8 years ago

4 argument to helper is source, to create escape helper I just return source and it work.