2016-07-17 12:35 GMT+02:00 Michael Vostrikov <michael.vostri...@gmail.com>:

> >
> > Multiple arguments would make the syntax even cleaner:
> > <?* $str, 'js', 'html' ?>
> >
>
> I thought about it. Multiple arguments do not allow runtime modification
> (and make the parser more complex).
> Something like this:
> <?php
>     $context = [];
>     if ($field->name == 'url') $context[] = 'url';
>     $context[] = 'html';
> ?>
> <div data-my-attr="<?* $field->value, implode('|', $context) ?>"></div>
>

Context should be defined where the variable is printed. Otherwise you move
the variable from HTML text to an attribute or add it somewhere else and
the context doesn't match anymore.

Regards, Niklas

Reply via email to