Closed ghost closed 8 years ago
Don't wrap your php in handlebars notation. PHP tags will be passed through assemble / handlebars unmodified if you write them as normal.
{{{ <?= $firstname; ?> }}}
should be simply <?php echo $firstname; ?>
NOTE: The previewer will not parse or display your php code and the templates will still have .html extensions. You can go the extra mile to support .php extensions.
in file grunt/assemble.js
add:
options:
ext: '.php'
Then for preview you'd have to add express-php via npm and in file server.js
adapt the view engine from ejs
to php
Well chalk one up to thinking way too far into it.
Thanks so much.
How can I use PHP echo statements in my templates?
I'm creating a whole set of html email template to drop into a PHP application. The end result in the templates once they've been compiled, needs to retain the
<?= $variable; ?>
so that they can be parsed in the application.I tried escaping them with
{{{ <?= $variable; ?> }}}
but assemble throws an error.Template looks like so:
Ideas?