Page 1 of 1

Why are we still using Twig templates?

Posted: Thu Oct 25, 2018 1:21 am
by JNeuhoff
Why do we need Twig? They add no new improved functionality, quite to the contrary! See Daniels own notes on this in system/library/template/twig.php:

Code: Select all

	/*
	 * FYI all the Twig lovers out there!
	 * The Twig syntax is good, but the implementation and the available methods is a joke!
	 *
	 * All the Symfony developer has done is create a garbage frame work putting 3rd party scripts into DI containers.
	 * The Twig syntax he ripped off from Jinja and Django templates then did a garbage implementation!
	 *
	 * The fact that this system cache is just compiling php into more php code instead of html is a disgrace!
	 */
Why not using PHP templates? OpenCart is a PHP framework, and PHP already IS a templating system anyway!

Re: Why are we still using Twig templates?

Posted: Thu Oct 25, 2018 2:15 am
by thekrotek
I second this. TWIG is hated by most OC developers, doesn't bring anything good and only makes development more complex. At least it could've been added as an alternative to default TPL.

Re: Why are we still using Twig templates?

Posted: Mon Oct 29, 2018 10:59 pm
by MarketInSG
I would see it as OpenCart 4.0 if we rid of TWIG.

Re: Why are we still using Twig templates?

Posted: Tue Oct 30, 2018 9:40 am
by agatha65
thekrotek wrote:
Thu Oct 25, 2018 2:15 am
TWIG is hated by most OC developers, doesn't bring anything good and only makes development more complex.
+1

Re: Why are we still using Twig templates?

Posted: Tue Oct 30, 2018 6:58 pm
by k2tec
Why not using PHP templates? OpenCart is a PHP framework, and PHP already IS a templating system anyway!
+1

Re: Why are we still using Twig templates?

Posted: Tue Jun 18, 2019 12:26 am
by hamrodev
I agree completely on this.
The usage of twig is - mildly put - a perfect example of overengineering that adds no additional value and was just implemented because symfony....

Re: Why are we still using Twig templates?

Posted: Mon Aug 12, 2019 1:09 am
by NikkiMarie
Greetings,

Hmmm.... would I be wasting my time learning Twig to create my own theme then? Is there a real chance it will be removed from use in future releases of OC?

Many thanks!

Re: Why are we still using Twig templates?

Posted: Mon Aug 12, 2019 3:11 am
by OSWorX
NikkiMarie wrote:
Mon Aug 12, 2019 1:09 am
would I be wasting my time learning Twig ..
I would say, in this branche it is never a waste of time to learn new.

NikkiMarie wrote:
Mon Aug 12, 2019 1:09 am
Is there a real chance it will be removed from use in future releases of OC?
No.

Re: Why are we still using Twig templates?

Posted: Sun Aug 18, 2019 1:04 pm
by NikkiMarie
Very true. Wasting time was a poor choice in wording. Thanks for the reply!