[RFC] Template procedures
Re: Template procedures
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.
Re: Template procedures
@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...
@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
Re: Template procedures
I must say that the must-not-follow-smarty-even-if-it-kills-us attitude is unreasonable.
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.Acyd Burn wrote:For example, could it be used to generate something for the "User name and colouring"?
Don't give me my freedom out of pity!
Re: Template procedures
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).APTX wrote:I must say that the must-not-follow-smarty-even-if-it-kills-us attitude is unreasonable.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.Acyd Burn wrote:For example, could it be used to generate something for the "User name and colouring"?
Most here hate the smarty syntax and how it handles things. I would never ever allow the smarty syntax to be used for example.I must say that the must-not-follow-smarty-even-if-it-kills-us attitude is unreasonable.
Re: Template procedures
He was merely pointing out that just because smarty does something doesn't mean it's bad.
Re: Template procedures
Perhaps we could make this public for the RFC?
Re: [RFC] Template procedures
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..
@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
Everything has ø in it
Re: [RFC] Template procedures
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)
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)
Re: [RFC] Template procedures
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
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
Re: [RFC] Template procedures
Well making the template language more complicated kind of defeats its point. So additions need to be carefully examined for their usefulness.