[TYPO3-mvc] Splitting a controller into sub-controllers or how to

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Wed Jan 20 22:19:00 CET 2010


Good evening!

Dou to the fact, that some controllers get a bit huge,
for example my checkout controller, which should be able
to display several checkout steps in a dynamic way.

So, therefor I'd like to create a method 'registerStep()'
which would register a new checkout step. The checkout
controller itself would then take care of displaying
the steps in a correct order or even redirect to a specific
step, if some data is still missing or needs to be updated.

Also every step should be validated, before the controller
would redirct to the next step. Furthermore it may be handy
to register additional steps on the fly, or skip steps on
different accations or in special situations.

Now I wonder how to implement such a system.

Could there be sub-controllers, which could be handled by
Extbase or even called by the main controller? If not, what
would be the best approach for this requirements?

One idea I came up with, is to create an interface for
checkout steps, and an abstract class checkout step, which
would be used to actually serve as extendable classes to
define concrete checkout steps. Those steps would then
consist of actions like 'show', 'validate', etc.

So this sounds quite like action controllers to me. Is there
any easy way to create sub-controllers? Implementing real action
controllers for each step is nothing I want to go with imho.

Any ideas or experiences?

Thanks a lot,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list