[TYPO3-ect] latest extension coding guidelines
Ingo Renner
typo3 at ingo-renner.com
Tue May 29 20:36:13 CEST 2007
Ries van Twisk wrote:
>> 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
* well, you could just name your subpart ###LOOP_NEWS### ...
* you can format data with TS
* let's not talk about the code of tt_news. That's a different stoy,
tt_news has grown over time and we know that it needs a 3.0 rewrite to
keep it maintainable at all.
> 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.
this is possible, at least in tt_news it's so flexible that you can have
hundreds of alternative/alternating
>> 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.
Why do you limit yourself?
The core at the moment says it's working on PHP4 AND on PHP5, but itself
uses PHP4 only. I'd always use PHP5 if I can.
No one is going to limit you. Especially as it's an extension not the core.
Ingo
More information about the TYPO3-team-extension-coordination
mailing list