MyBB Community Forums

Full Version: Templating
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry if this has previously been posted but I'm wondering what was behind the decision of using Twig as the templating engine as opposed to Blade which is already built into laravel?
IIRC we chose Twig because it doesn't allow raw PHP unlike Blade. I presume the idea is to allow templates to be edited from both the ACP and the filesystem, and we don't want administrators to be able to execute arbitrary PHP code.
Exactly as Nathan said. Blade allows you to use any PHP function inside templates, which would make moderating themes submitted to the mods site even more difficult than it already is (e.g.: checking that templates don't have code to "rm -rf /" and delete the whole system). Twig allows us to limit the functions available, whilst still offering a lot more power than the current system.

Additionally, Twig is used by multiple other systems (include phpBB if I remember correctly), which should mean that it's easier for theme designers to get started creating themes for MyBB 2.0.
(2016-09-15, 06:07 PM)Euan T Wrote: [ -> ]Exactly as Nathan said. Blade allows you to use any PHP function inside templates, which would make moderating themes submitted to the mods site even more difficult than it already is (e.g.: checking that templates don't have code to "rm -rf /" and delete the whole system). Twig allows us to limit the functions available, whilst still offering a lot more power than the current system.

Additionally, Twig is used by multiple other systems (include phpBB if I remember correctly), which should mean that it's easier for theme designers to get started creating themes for MyBB 2.0.

Cool, thanks for the explanation.