Why did you implement IF, BEGIN etc. using comment syntax (<!-- blah --> ). Why don't you make use of processing instructions syntax (<?blah?>), which - I think - seems to by more logical (at least for people knowing XML)? Or - as in Smarty - {blah}, which is more uniformed, consistent?
And what do you think about this article? http://www.massassi.com/php/articles/template_engines/" target="_blank
The 2.2 styling system ... feedback
Re: The 2.2 styling system ... feedback
Logical, uniform, consistent? Well, why shouldn't Smarty be consistent with us instead of the other way around !
The syntax for a phpBB template ( comment syntax ) comes from PHPLib. Although the current template engine shares zero code with the one in PHPLib, the syntax for templates remains.
As to that article.. very basic ideas on caching and template engine design. Nothing extraordinary special.
The syntax for a phpBB template ( comment syntax ) comes from PHPLib. Although the current template engine shares zero code with the one in PHPLib, the syntax for templates remains.
As to that article.. very basic ideas on caching and template engine design. Nothing extraordinary special.
Freedom from fear
Re: The 2.2 styling system ... feedback
I always shudder if i see the smarty syntax, it is far away from readable, as well as short tags or xml is. I think if you present a designer a template you have to make sure the designer is able to get the logic and being able to change it and not a programmer. HTML Comments are known to a designer, it is readable (because you see it and notice it) and editors with syntax highlighting work better with it. Smarty has become a scripting language and has IMO nothing to do with a template engine. In phpBB3 there has been more logic added, but i think it is a good weight between features/logic and useability.
Apart from this, as per David.
Apart from this, as per David.
Re: The 2.2 styling system ... feedback
Not the implementation is interesting there. Rather point of view, summarised in last sentence:DavidMJ wrote: very basic ideas on caching and template engine design.
Well - it's true - because in many cases code MUST interact with content. Does it mean we need to invent a new scripting language, wich will be parsed by scripting language and compiled to scripting language? Adding a logic to the template engine is simply mapping of PHP features. For what? Is reallyIn short, the point of template engines should be to separate your business logic from your presentation logic, not separate your PHP code from your HTML code.
Code: Select all
<!-- IF foo eq "bar" -->
Code: Select all
<? if (foo == "bar") ?>
Designer in both cases must learn the syntax - in first case he knows only what <!-- --> is, nothing else. Well, according to readability, first case is worse than second, because it is treated by editor with syntax highliting as a comment and made whole gray (for example). PHP code is highlited as a code - different color for if, different for foo. It is more readable.
And a different problem: how level of error reporting dose a template engine provide? Is debugging a template with syntax errors as easy as debugging PHP?
Re: The 2.2 styling system ... feedback
I really do not know why you are even discussing this, since we will not change the template engine.
We think it is easier for everyone and the conditional statements were added because they were needed. The statement you quoted is not used very often, most often only loops will occur and if statements without a comparing equivalent.
And why is
better than (changed it, because your example is not possible at all, every variable is written in uppercase to make them more visible)
?
Let's break them down, ok? <!-- and --> can be removed, they are known to the designer (he at least knows that it is not printed out at the page because it is a html comment). So, the condition IF is the same for both, the variable too ("bar"), the comparing character is different, but means the same (we allow both, those wanting to add a word (eq, neq, gt, lt, or, and, etc.) and those used to use ==, !=, <>, etc.). Now with your code you have the additional confusing characters as (, )...
Also, keep in mind that the phpBB template engine has been build for phpBB, only for phpBB. It is not meant for other projects or other fields of usage. It is doing what it should do, what it was designed for.
If i look at smarty templates i always question if people are really able to distinguish between those elements "presented" and those elements which are logic dependent. But smarty might be a very bad comparison here, due to smarty being a scripting language. Anyway, this was it from me regarding phpBB's template engine... views will continue to differ regarding template engines.
We think it is easier for everyone and the conditional statements were added because they were needed. The statement you quoted is not used very often, most often only loops will occur and if statements without a comparing equivalent.
And why is
Code: Select all
<? if (foo == "bar") ?>
Code: Select all
<!-- IF FOO eq 'bar' -->
Let's break them down, ok? <!-- and --> can be removed, they are known to the designer (he at least knows that it is not printed out at the page because it is a html comment). So, the condition IF is the same for both, the variable too ("bar"), the comparing character is different, but means the same (we allow both, those wanting to add a word (eq, neq, gt, lt, or, and, etc.) and those used to use ==, !=, <>, etc.). Now with your code you have the additional confusing characters as (, )...
Even better. Then the template authors do not mess with the logic too much and only concentrate on their business (layout). Olympus' templates conditional statements will not changed that much, mostly it will be moved around for new variants (and to a certain extend new styles).because it is treated by editor with syntax highliting as a comment and made whole gray (for example)
A designer should never touch the code, what a mess this would be has been seen in phpBB1. Since coders are dictating what is available within the template the designer has no way to change the code but is still available to change the presentation. The coder gives the designer some variables (language variables are now an exception because they are globally available) and the designer can decide what he/she wants to do with it.And a different problem: how level of error reporting dose a template engine provide? Is debugging a template with syntax errors as easy as debugging PHP?
Also, keep in mind that the phpBB template engine has been build for phpBB, only for phpBB. It is not meant for other projects or other fields of usage. It is doing what it should do, what it was designed for.
If i look at smarty templates i always question if people are really able to distinguish between those elements "presented" and those elements which are logic dependent. But smarty might be a very bad comparison here, due to smarty being a scripting language. Anyway, this was it from me regarding phpBB's template engine... views will continue to differ regarding template engines.
Re: The 2.2 styling system ... feedback
Just curiosityAcyd Burn wrote: I really do not know why you are even discussing this, since we will not change the template engine.
How much designers did you ask if it was confusing? In both cases there is something to learn.Acyd Burn wrote: Now with your code you have the additional confusing characters as (, )...
But it is presentational logic!Acyd Burn wrote: Then the template authors do not mess with the logic too much and only concentrate on their business
That makes sense 8)Acyd Burn wrote: A designer should never touch the code, what a mess this would be has been seen in phpBB1. Since coders are dictating what is available within the template the designer has no way to change the code but is still available to change the presentation.
It would be great if phpBB... er... 4.0 contained more portable, reusable code. Like in Open Power Board which provides completly autonomic templating engine and DBAL... I know - no feature requestsAcyd Burn wrote: Also, keep in mind that the phpBB template engine has been build for phpBB, only for phpBB.