Use templating engine in views
As the title says, I think it might be a good idea to start using a templating engine like Twig (which could be provided by the WyriHaximus/TwigView plugin?) or build one ourselves.
This is to prevent the more front-end oriented contributor from having to write stuff like:
<?= h(__d('kikioboeru/kikioboeru',$child['label'])); ?>
While this is not a problem per definition, there are two problems here that might cause some issues in the long run:
- Developers have to manually escape the value (which we all know, might be forgotten from time to time)
- It's ugly (it'll get long and it'll get fairly unreadable with a bigger statement)
I think using Twig might be a good option for this except that it does require the .ctp
files to be renamed to .twig
, which might add an additional amount of confusion.
Building our own engine will be a lot of work considering it has to not impact performance too much and still be safe and easy.
I hope to hear what you guys are thinking :)