Take a look at https://laravel.com/docs/5.3/blade#php
Laravel Blade vs Twig
Hi guys,
first, let me say i like Laravel a lot. And also i like Blade.
BUT... i have a dilemma. we are planning to start a new 'larger-scale' project in a few months. We plan to create SaaS solution where users should be able to edit templates. The project should be supported for the next 5-10 years. So we need a long term solution. Now the problem with Blade is that you cannot sandbox it. So all users can place PHP code directly into the templates, that's a no-go. What options do we have?
Did authors of Laravel ever consider about adding Sandbox option to Blade? If we take a look at the Twig on the other side, it offers Sandbox mode.
TWIG: "Secure: Twig has a sandbox mode to evaluate untrusted template code. This allows Twig to be used as a template language for applications where users may modify the template design. In Twig, your template designer can’t easily take shortcuts. Eg. calling a query in your templates. They’ll have to pass the result to the view or allow access to a certain function..."
It seems like Twig would be perfect for the job where users must be allowed to edit their templates in the 'cloud' ?What do u guys think?
On the other hand, Symfony's official template engine is Twig. Should we just go with Symfony (which i am not very familiar with yet) or should we use the Twig Bridge module (its on the github)? I don't like the idea that TwigBridge module is maintained by one guy and if he decides to drop support for it, we have a problem. This won't happen with Symfony, since it is their official template engine.
What would u guys do?
best regards, Jim
Please or to participate in this conversation.