[TYPO3-dev] Ideas solving the bloated TER problem?
Bernhard Kraft
kraftb at kraftb.at
Wed Nov 25 18:28:46 CET 2009
Jigal van Hemert schrieb:
> A good opportunity to move to extBase/Fluid? ;-)
Just doing everything in an MVC concept is not the solution of all
problems. Even MVC applications can be coded in a bad style.
I recently saw an application which claimed to use the MVC concept. But all
the programmer did to achieve this title for his application, was to call
separate methods for displaying the different views, and calling some
methods to retrieve the data ...
In my opinion a good (FE) extension must meet the following criteria:
* If there is FE output use a templating engine (either TYPO3 native or
smarty)
* If the extension retrieves information from the database for output in
the FE pass every field through cObj->stdWrap in a loop (No need to
handle every field on it's own like with sr_feuser_register and have a
cemetery of field handling stuff)
* If the extension has FE output also allow to insert cObjects as markers
into the template
* Also pass every field/config variable used for generating queries/etc.
through stdWrap
For me it seems many developers have never really understood the concept of
stdWrap.
Also I quite often see, that every field get's handled on it's own. Why is
there something like
$url = $this->cObj->typoLinkURL($row['link'], $myLinkConf);
in an extension when this could be achieved with something like:
--------------------------------------------------------------------
foreach ($row as $key => $value) {
if ($fieldConf = $this->conf['fieldConfig.'][$key.'.']) {
$row[$key]=$this->cObj->stdWrap($value, $fieldConf);
}
}
--------------------------------------------------------------------
And some TypoScript like:
plugin.tx_myext.fieldConfig {
link {
typolink {
parameter = 123
additionalParams = &useTyposcript=YES
}
}
}
Using something like the above approach handles almost any thinkable
situation. You do not need to edit extension code again and again to fit
all your needs. Just configure it using TypoScript!
greets,
Bernhard
More information about the TYPO3-dev
mailing list