[RFC] Template procedures

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: Template procedures

Post by Acyd Burn »

To make it quite clear: i won't support adding every single "cool" thing just because it is able to be added. I only will support adding new features to the template engine if they are really needed. I think at the moment too much work is put into the template engine - it should've stopped with implementing streams.

Image

User avatar
DavidMJ
Registered User
Posts: 932
Joined: Thu Jun 16, 2005 1:14 am
Location: Great Neck, NY

Re: Template procedures

Post by DavidMJ »

@APTX: can you prototype some examples where we could use this within our own code at some sort of savings, either complexity or redundancy of code

@Acyd Burn: I do not think we should arbitrarily halt development on any area if we see a need exists. For example, it looks like template inheritance is going to be pretty popular... Another thing is that streams was just an implementation level issue, it was not like we were gluing in the kitchen sink or allowing for crazy things. I think being able to make arbitrary DEFINEs will be quite useful so I added that feature today...
Freedom from fear

APTX
Registered User
Posts: 680
Joined: Thu Apr 24, 2003 12:07 pm

Re: Template procedures

Post by APTX »

I must say that the must-not-follow-smarty-even-if-it-kills-us attitude is unreasonable.
Acyd Burn wrote:For example, could it be used to generate something for the "User name and colouring"?
I looked into how it's done currently in phpBB. It is done by a PHP function, generate_user_string(), which just generates HTML and goes as far as replacing template-like variables in the generated markup. That should really be in templates. Though procedures would most likely not be enough for this. Functions should be possible in the template engine, but without proper expression handling they would be quite useless as they would be severely broken.
Don't give me my freedom out of pity!

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: Template procedures

Post by Acyd Burn »

APTX wrote:I must say that the must-not-follow-smarty-even-if-it-kills-us attitude is unreasonable.
Acyd Burn wrote:For example, could it be used to generate something for the "User name and colouring"?
I looked into how it's done currently in phpBB. It is done by a PHP function, generate_user_string(), which just generates HTML and goes as far as replacing template-like variables in the generated markup. That should really be in templates. Though procedures would most likely not be enough for this. Functions should be possible in the template engine, but without proper expression handling they would be quite useless as they would be severely broken.
At the moment the plan is to just use INCLUDE (which would work fine - the code logic is in the code and the design snippet being included).
I must say that the must-not-follow-smarty-even-if-it-kills-us attitude is unreasonable.
Most here hate the smarty syntax and how it handles things. I would never ever allow the smarty syntax to be used for example.

Image

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: Template procedures

Post by naderman »

He was merely pointing out that just because smarty does something doesn't mean it's bad.

ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Template procedures

Post by ToonArmy »

Perhaps we could make this public for the RFC?
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

Rotsblok
Registered User
Posts: 325
Joined: Mon Nov 14, 2005 12:21 pm
Location: x= y+1

Re: [RFC] Template procedures

Post by Rotsblok »

If I understand it propperly then I think it would really add something for style authors.

@naderman Have you ever seen a joomla style? In my eye's it's the most illogical, unpractical style code there is.. For ppl with little to non understanding of php it's almost undo-able to create one.. phpBB has now a very nice understandable clean style..
ø = 1.618033988749895...
Everything has ø in it

ckwalsh
Registered User
Posts: 54
Joined: Tue Apr 18, 2006 2:25 am

Re: [RFC] Template procedures

Post by ckwalsh »

Just saw this, and it seems rather neat.

However, I hope the template system could be expanded to support more complex logic. While html macros are nice, what if I want to add completely new functionality to the template system, such as an automated spriting system, or a handler that performs php logic? I currently need to hack such functionality into the phpBB core.

In my ideal world, very few template commands would be implemented core, and rather as modules that are loaded at compile time. Since compilation is relatively infrequent, it is not particularly bad to sacrifice performance in this step (to a reasonable degree)

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

Re: [RFC] Template procedures

Post by MichaelC »

I would say this would make a fair few people's lives alot easier. So I would vote for it.
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
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: [RFC] Template procedures

Post by naderman »

Well making the template language more complicated kind of defeats its point. So additions need to be carefully examined for their usefulness.

Post Reply