Post by psytanium » Sun Mar 14, 2021 3:18 am

Hello,

As a web developer, I try to learn to customize most available platforms, I really like the architecture of Opencart, it's somehow similar to a decent but retired platform called OSC. But 1 annoying feature with Opencart is the existing of PHP engines, TPL previously and TWIG recently.

Other major platforms like WordPress and Magento didn't integrated any of those. Can I know what are the main reasons to use those languages on top of PHP ?

Thanks

Active Member

Posts

Joined
Fri Nov 27, 2015 2:07 am

Post by nickpapoutsis » Sun Mar 14, 2021 8:59 am

I don't know why Daniel did it but I really like working with TWIG. TPL on the other hand can suck my ***

User avatar
New member

Posts

Joined
Mon Mar 25, 2019 7:49 am

Post by JNeuhoff » Sun Mar 14, 2021 9:31 pm

Using Twig as a template engine certainly was a poor choice.

The Symfony implementation of Twig is of poor quality, it does not directly translate from Twig into the final HTML.

It's language syntax is bad, no proper LALR(1) grammar is defined here. Some of its operators use strange notations, such as for the binary operators using 'b-or', 'b-and', and 'b-xor' instead of the more common '|', '&', and '^'. It has a number of duplicate functions and tags doing he same thing. It uses the strange '~' as the string concatenator. In other languages the '~' stands for the not-operator, and they use '+' or '.' for the string concatenator.

It has a non-intuitive filter syntax, instead of using simple functions for this.

There are other template engines out there doing a better job. PHP itself is already is a template language anyway. Twig is just another example of trying to re-invent the wheel.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by psytanium » Sun Mar 14, 2021 9:58 pm

JNeuhoff wrote:
Sun Mar 14, 2021 9:31 pm
Using Twig as a template engine certainly was a poor choice.

The Symfony implementation of Twig is of poor quality, it does not directly translate from Twig into the final HTML.

It's language syntax is bad, no proper LALR(1) grammar is defined here. Some of its operators use strange notations, such as for the binary operators using 'b-or', 'b-and', and 'b-xor' instead of the more common '|', '&', and '^'. It has a number of duplicate functions and tags doing he same thing. It uses the strange '~' as the string concatenator. In other languages the '~' stands for the not-operator, and they use '+' or '.' for the string concatenator.

It has a non-intuitive filter syntax, instead of using simple functions for this.

There are other template engines out there doing a better job. PHP itself is already is a template language anyway. Twig is just another example of trying to re-invent the wheel.
Personally I find this TWIG add more complication to the job.. Unless it have a really good purpose. I tried to search what could be the purpose, and the only repetitive answer was "security reasons". But I think PHP con't lack proper security.

That's why I asked the community here maybe there is a cause or more to use it.

Active Member

Posts

Joined
Fri Nov 27, 2015 2:07 am

Post by JNeuhoff » Sun Mar 14, 2021 10:12 pm

Personally we use the PHP template engine for some extensions with the aid of the Template Switcher on multiple OpenCart 3.x sites.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 9 guests