[TYPO3-ect] latest extension coding guidelines
Ries van Twisk
typo3 at rvt.dds.nl
Tue May 29 15:53:04 CEST 2007
On May 29, 2007, at 7:46 AM, Ingo Renner wrote:
> Ries van Twisk wrote:
>
>> Doing things MVC and OO is indeed not the TYPO3 way, but I do feel
>> it's the right way, that was the whole intention of the extension.
>
> My opinion is that MVC for sure is a good design pattern. But you
> can't
> use it for everything.
>
Fully agreed... However for the stuff extensions are doing
(retrieving data, respond to input, display data) it is doing a great
job.
> A thing that I especially don't like about lib/div is that it
> introduces
> or works around the TYPO3 standard templating mechanism by
> inserting PHP
> code into HTML templates.
Personally I don't use that method myself, and I am only using smarty
for my extensions. TYPO3's templating system is just horrible...
>
> In fact we have that modern template building concept to not have PHP
> within HTML and to let designer work on the HTML templates without the
> fear they could destroy something.
>
I won't call it modern...
> Even when doing MVC, lib/div could use the marker concept for
> templates.
> You could still have a marker ###SOME_TEXT### rendered by a PHP method
> $someObject->getSomeText().
My big problem with the marker concept is that it does a horrible job
for
anything that is repeated. I cannot loop through datasets and I cannot
format incoming data. All this needs to be done within the extension.
As you can see from extensions like tt-news, user-register etc
the code is just horrible to work with. And from many users I get
complains
that TYPO3's templating methods are from from easy if you need to
have anything
that the phpcode of an extension cannot handle
For example to create a template with alternating row colors during
list display
is virtually impossible without creating a odd and even templates
parse that with php.. render that using the markers... truly
horrible. (what if I want
to have 3 colors during list display in tt_news, it's impossible and
non flexible.
I know that smarty is not a holy grail as well (but close IMHO, but I
don't want to go
into that debate), but at least I am much more flexible with my data
and how I
render it. I don't know about lib/divs phptemplate, but I think it's
possible with PHP code.
>
> IMO this would be more consistent with the rest of TYPO3 and what
> keeps
> me from using lib/div until this is resolved. There're some special
> ways
> in TYPO3 whether you like them or not that should be kept.
I don't like TYPO3's templating system at all. For me it creates
a huge mouth of extra coding that needs to be done on my end to get
simple
things work. Also for change requests I often need to dig into code
to make it work. AlsoTYPO3's templating system doesn't work with
anything
else but LATIN1 templates. And one day I spend a lot of time trying
to figure out
why a template created in the Estonian language didn't work on cached
pages, but only on non-cached. (the template wasn't retrieved from
cache correctly for
some reason and yes everything was done in UTF-8, but I think that
typo3's internals
are not fully UTF-8 compliant).
With lib/div you do have the possibility to create a other template
engine,
and you are free to create one and I am sure that the ECT team is
more then happy
to accept the class set for it. I created a smarty view with Steffen
Kemper, Elmar created
his phptemplate and you may be classic TYPO3' templating?
>
> The other thing is that it is not PHP5. I mean if we're starting a MVC
> library, why do we use PHP4 then? If I remember right I've even seen
> comments in lib/div like "we can't do this or that because of PHP4"
> - so
> why using PHP4 at all? If you want to do serious MVC you should
> also go
> with PHP5. If you do things, do them right.
Com on, don't give me that!!! For the whole sake of typo3
compatibility we do it in PHP4.
So I do feel that when typo3 core says php4 rulez, then extensions
should work (where possible) with php4 aswell.
>
> Other than that, for TYPO3 5.x things can change of course... but
> lib/div is still made for the 4.x branch, isn't it?!
Yes, with a eye looking at typo3 v5. However Typo3 version 5 has a
loooooooong way
to go. And I do feel it's now not a good thing to think about 'will
this and that be compatible with V5.
Unless the typo3 V5 teams will tell me that all extensions will
function in V5, but if that is true
then they should re-think there goals.
I didn't hear much about V5 lately (a lot of it is german anyways),
so I expect it will be at least 2-3 years from now until V5 is
anywhere close to usable anyways not something I currently look into.
Ries
More information about the TYPO3-team-extension-coordination
mailing list