[TYPO3-ect] Controller for Typo3

Joerg Schoppet joerg at schoppet.de
Wed Mar 22 09:29:39 CET 2006


Hi list,

I just want to discuss over some controller-issues for fe-extensions.

Elmar pointed me to http://www.underused.org/code/a-simple-controller-class-for-typo3/ , but there I see some disadvantages in some cases. The "simple-controller" needs to have special links (because it uses a get/post-var 'cmd' for 'switching'). So you can not use the typo3-sitestructure for display of a menu and for access-management.

I would prefer an additional instance:

Example:
I created a request system. This system should consists of some functionality (!!!)
- creating of requests (all users)
- displaying of self-created requests (all users)
- working with requests (special users)
- reporting of requests (special users)

Each of this functions should resist on his own page in typo3 (benefit: Simple linking, access-restrictions by typo3). So I created four pages and on each page I included my plugin. The plugin has a flexform with a select-box in it. each option of the select-box correspond with one of the four functions.
In my extension I've build up a 3-tier-layer:
- process (one class for each function containing the business logic)
- domain (one class for each persistent object)
- application (one class for each function)

In my pi1-class I read out the option of the flexform. With a simple switch-statement I get the corresponding process-class and call a general function in this class. The process-class knows, which domain-classes and which application-class it needs for further processing and returns the output of the application-class back to the pi1-class, which simple return it.

I think through this behavior I can benefit from both, the typo3-capabilities of building menues and access-control and from a lot oo-features like mvc-pattern, singletion and so on.

What do you all think about this approach?

Regards
Joerg Schoppet



More information about the TYPO3-team-extension-coordination mailing list