Twig as our template engine

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Twig as our template engine

Post by MichaelC »

imkingdavid wrote:I can agree to that. We just need to ensure that Twig can accomplish everything we need (including the new template events, etc.)
As I already said, it does. ;)

With regards to changing template syntax, I think we should break BC as soon as we can; lets try and break all BC in the first few major releases of 3.x; then later on we can keep BC until 4.0.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Twig as our template engine

Post by EXreaction »

What is the benefit of using twig's syntax rather than ours?

Is it not possible to support both syntax types?

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: [RFC] Twig as our template engine

Post by Pony99CA »

Unknown Bliss wrote:With regards to changing template syntax, I think we should break BC as soon as we can; lets try and break all BC in the first few major releases of 3.x; then later on we can keep BC until 4.0.
What is "BC"? :?

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1905
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC] Twig as our template engine

Post by DavidIQ »

Backwards Compatibility.
Image

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Twig as our template engine

Post by callumacrae »

EXreaction wrote:What is the benefit of using twig's syntax rather than ours?
The phpBB template syntax is disgusting, that's what. It's also impossible to get IDE support for it without a dedicated plugin, while my IDE support Twig (error reporting, code completion, debugging, other stuff I haven't worked out yet).
EXreaction wrote:Is it not possible to support both syntax types?
Probably, but I don't think that that is an ideal solution. It'll make style updates and modification installations tricky (here are the style changes for the old style, here are the code changes for Twig), and will increase the amount of stuff that the style team need to do.
Made by developers, for developers!
My blog

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Twig as our template engine

Post by Arty »

EXreaction wrote:What is the benefit of using twig's syntax rather than ours?
It makes sense to use all twig features, not emulate phpbb template engine using twig. Syntax like {% for item in list %}, {% set var = {'a': 'b'} %}, {{ whatever|e }}, blocks/filters and most other twig features don't have phpbb template syntax counterparts.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Twig as our template engine

Post by EXreaction »

callumacrae wrote:
EXreaction wrote:Is it not possible to support both syntax types?
Probably, but I don't think that that is an ideal solution. It'll make style updates and modification installations tricky (here are the style changes for the old style, here are the code changes for Twig), and will increase the amount of stuff that the style team need to do.
I mean simultaneous support for both syntaxes. So Twig would parse both their syntax type and our old syntax type in the same file. If this would be possible, I think that would be something very good to do for a major version or two until people can get used to the new syntax type.

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Twig as our template engine

Post by Arty »

It might confuse users. Sometimes they'll see old syntax, sometimes new. Support, mod and style authors will have to learn both.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Twig as our template engine

Post by MichaelC »

Arty wrote:It might confuse users. Sometimes they'll see old syntax, sometimes new. Support, mod and style authors will have to learn both.
+1.

Plus readability would be nightmarish and twig uses a hierarchy structure (also support inclusions), phpBB uses inclusions.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1905
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC] Twig as our template engine

Post by DavidIQ »

I'd go one way or the other, not support both. If the phpBB template syntax is as horrible as it's being made out to be here then go with Twig.
Image

Post Reply