Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Blade and Twig [closed]

Tags:

php

twig

blade

I would like to know the difference between Blade and Twig templates.

What are the advantages of using one over the other?

like image 723
Ronser Avatar asked Oct 27 '14 06:10

Ronser


1 Answers

blade syntax is native to laravel, if you want to use Twig you need to setup packages for that(http://ilikekillnerds.com/2014/08/replacing-blade-with-twig-templating-in-laravel/).

you can find difference from this link https://laracasts.com/forum/?p=536-twig-over-blade/0

October CMS is build on top of laravel it uses Twig, and here is reasons why they use twig instead of Blade.

At a base level all templating languages are the same. Twig is a mature and robust templating language that is easy to learn. It also has Twig.js which can be used for client side rendering.

We could debate about the differences of Twig and Blade until the cows come home, at the end of the day, we went with Twig because it was a better candidate for October. It is important that a single templating language is used on the front-end, otherwise Themes and Plugins would not be compatible with each other.

refer https://octobercms.com/forum/post/why-twig

like image 124
Anand Patel Avatar answered Oct 04 '22 00:10

Anand Patel