roots / sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
https://roots.io/sage/
MIT License
12.76k stars 3.06k forks source link

Make PHP Templating Engine optional #2064

Closed landwire closed 6 years ago

landwire commented 6 years ago

Submit a feature request or bug report

Feature Request

Please provide use cases for changing the current behavior:

Like many people I would like to use twig instead of blade with Sage. Would it be possible to add these options during the theme setup dialog? I guess equivalent to the Front End Framework dialog...

  1. use blade
  2. use twig
  3. use none (which lets you set-up your own and removes all the blade related stuff)

I am not too familiar with Sage, so cannot tell if that is easy to implement the twig option. But at least the option not to use a templating language should be available. I do not want all the clutter that comes with blade, if I am not going to use it.

Thanks, Sascha

QWp6t commented 6 years ago

Blade compiler is technically optional if you rename your template files from .blade.php to .php. At that point your files will still be picked up by the view service provider and passed to the php engine.

At the moment we have no plans of adding a Twig compiler. As an alternative to Sage, there's a framework by htmlBurger called wpemerge that will simultaneously support Blade and Twig, but I can't attest to its implementation or quality as I haven't personally used it yet.