[TYPO3-ect] Controller for Typo3
Michael Scharkow
mscharkow at gmx.net
Wed Mar 22 15:50:37 CET 2006
Joerg Schoppet wrote:
> Hi Michael,
>
> I don't want to personal attack you or your code. Perhaps I've
> expressed the stuff with some wrong words. Sorry for that.
No, I'm sorry for sounding harsh, I did not feel attacked at all, actually.
> I think you are right, that there are a lot of similarities in our
> approaches. I've ported my thing from a another language-framework,
> in wich I've programmed several years. The main thing is the
> separation of business logic, persistent data and views.
JAVA? And we don't need to debate the usefulness of MVC here, obviously ;)
> Just one more question. If I need a multi-site layout, do I have any
> other possibility then flexform or CODE and then a switch-statement
> to handle this?
Do you mean *multi-page* layout, aka splitting the views onto different
TYPO3 pages? If yes, that's a no-brainer because in tt_news and
elsewhere you pass additional commands and variables to the plugin on
whatever page. So basically, using CODE for this kind of views is
redundant because the plugin 'knows' what to do with this additional piVars.
If you need a different view that works without additional parameters,
you need to tell the plugin what view to use, of course. Nonetheless,
you don't need the switch stuff but just one variable from TS or
Flexform which defines the default view.
$this->defaultAction = $this->conf['code'] ? $this->conf['code'] : 'index';
flexform or code: yes
switch-statement: no
> What do you mean with "DRY" principle?
Don't Repeat Yourself
Any code and logic should only be implemented only once and in one
place. This is often violated in TYPO3, e.g. if we have ext_tables.php
we don't need ext_tables.sql because one can be derived from the other.
In a plugin, we don't need to explicitly connect a view to a controller
if it can be derived from the controller name or a $conf variable.
GReetings,
Michael
More information about the TYPO3-team-extension-coordination
mailing list