mudasir
mudasir

I think we should create a wrapper(plugin) which will compile blade syntax to twig. This will help blade developers to write blade syntax and plugin will take care of everything.

andrewfenn23143
andrewfenn23143

Pretty upset and frustrated about this. The main page says it's a "platform based on the Laravel PHP Framework". Yet here I am, hours and hours spent, only to find out that you don't even support the default template engine in Laravel. So you've basically tricked me into wasting a whole bunch of time and effort on this assuming I could paste over all my blade template code.

You should change your main page and state what you're not compatible with in Laravel upfront so you don't waste others time like you did mine.

mike.reacher9531204
Briddle
Briddle

andrewfenn23143 said:

Pretty upset and frustrated about this. The main page says it's a "platform based on the Laravel PHP Framework". Yet here I am, hours and hours spent, only to find out that you don't even support the default template engine in Laravel. So you've basically tricked me into wasting a whole bunch of time and effort on this assuming I could paste over all my blade template code.

You should change your main page and state what you're not compatible with in Laravel upfront so you don't waste others time like you did mine.

Hmmmm.... Kerosine is based on oil. So is Nylon. Yet, planes do not fly on nylon T-shirts. Nobody was tricked here, this is no conspiracy. The fact that you did not do your homework and wasted your time can hardly be blamed on anyone but yourself. Like they say, "Assuming is the mother of all f***ups"

Ompmega
Ompmega

Laravel uses Symfony behind the scenes, and it comes with the Twig templating engine, so it makes sense that October uses Twig for templating. Also note that Blade requires file suffix .blade.php and that is a security issue because of .php file extension. October uses .htm and runs the markup through Twig, along with Yaml syntax that is placed on top of CMS pages. Twig is much safer for backend file editing, while Blade is NOT. Blade was not meant to be edited on an interface.

vedmant51911
vedmant51911

Yeah, I'm also frustrated about not supporting blade as well. Blade templates is one of the reasons I like Laravel.

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.

This doesn't make sense to me, why to force plugins to use any specific front end approach at all. It's Vue.js / React era right now, jQuery and Twig JS are outdated things.

Briddle
Briddle

vedmant51911 said:.

This doesn't make sense to me, why to force plugins to use any specific front end approach at all. It's Vue.js / React era right now, jQuery and Twig JS are outdated things.

You are confusing a templating language like Twig or Blade with a frontend framework like Vue or React. These are two completely different things.

There are valid reasons to prefer Twig as a templating language and there are valid reasons to prefer Blade.

Views of plugins and themes should use the same templating engine as they are used on the same page. October opted for Twig. That is a perfectly valid choice and one that cannot be changed now. Besides, changing it would not offer any benefit other than personal preference.

Twig is an independent component, meaning it can be used in any framework or free-standing PHP application (even including WordPress). Blade is only used within Laravel. As a result more front-end developers will be familiar with Twig than with Blade.

If you are migrating some Laravel software to October you should expect to make changes to your code to make the best use of October anyway. That car X and car Y are both built on the same undercarriage does not mean you can switch any part of car X for any part of car Y.

Last updated

Mauritak
Mauritak

I would also prefer Blade, it have more readable and elegant syntax. In my opinion it's also more powerful and it's native to Laravel therefore expected in Laravel based project and familiar to Laravel developers.

BTW: If my memory servers me correctly, Blade is based on Twig so basically it's just improved Twig.

daftspunk
daftspunk

BTW: If my memory servers me correctly, Blade is based on Twig so basically it's just improved Twig.

Blade is based on Razor, a Microsoft.NET technology, since Taylor Otwell used to work a lot with this stack, he decided to port it to PHP. Blade has had many breaking changes over the years

Twig is far more mature syntax and with farther accessibility reach. It also has some cool API accessors that work well with CMS components. We made the right choice using it. It may be a little off-putting to get used to when coming from Blade, but it is more aligned with our philosophy and vision for the platform

Briddle
Briddle

Mauritak said: BTW: If my memory servers me correctly, Blade is based on Twig so basically it's just improved Twig.

  1. Euh.... no. The mere fact that something is based on something else does not make it better, just different. It remains a matter of personal preference. I can create a new CMS based on OctoberCMS and make my CMS far, far worse....

  2. Like mentioned before (multiple times in fact) there are valid reasons to prefer Twig as a templating language and there are valid reasons to prefer Blade. Your assumption that most developers on October CMS will have a Laravel background is probably wrong. The chance of those (non-laravel) developers knowing Twig is far greater than them knowing Blade.

  3. Views of plugins and themes should use the same templating engine as they are used on the same page. October opted for Twig. That is a perfectly valid choice and one that cannot be changed now since it would impact all themes in use without any valid reason other than personal preference. This is not about personal preference but about what works best for most people.

Last updated

Mauritak
Mauritak

Yes, you're right, extending something does not make it automatically better. In case of components that Laravel have extended from Symfony and other frameworks/packages it makes them better. But not because it's build on top of something but because it's build by competent developers which know what they are doing.

I worked with Laravel in many versions over the years, I've started somewhere in version 3. I'm to this date not aware of any serious breaking changes, the syntax and everything is more or less the same over the years, there were just some more additions to make our life easier but the whole structure and workflow is still the same.

If they were the same, I would still go with Blade because the syntax is far more user friendly. For example the blocks where twig uses "{% %}" for everything is very confusing and takes slightly longer to mentally parse the code every time you open the file. Everything loooks the same, have the same visual weight, is more awkward to type and so on. The Blade have the structure clearly separating "{{ }}" and "@something" for example.

Laravel is the most popular framework at this moment with biggest developer community. When the developers look for a CMS build on top of Laravel, they expect to see Laravel under the hood. I certainly have. Seeing something else under the hood is confusing.

I understand that you don't want to make unnecessary breaking changes to the CMS and I agree with that. I'm not saying that the templating engine must be swapped under the hood just pointing out that something here is not quite right and seeing users bringing this up over and over again over the years is pointing to that. Not to mention all the users that take it as it is and does not speak up.

I think that the best solution would be to build some kind of an adapter which would convert blade to twig and allowing users to opt in to this feature. It does not even have to be perfect to start, most users use at most 20% of the features so enabling just handful of basic features and putting a warning on the feature as experimental would be sufficient to make most people heappy.

21-31 of 31