[TYPO3-ect] How to convert plugins to MVC/lib/div ?

Fabien Udriot fudriot at omic.ch
Thu Jun 28 16:47:39 CEST 2007


 > What is the way to convert exisiting plugins to MVC ?
Well, the old way to produce extensions is not very compatible with the 
MVC paradigm. The conversion from the old model to the new one depends 
on how is build your extension and on how you coped with the differents 
layers.

I would advice following :

- install the extension apples (which is the minimalist extension)
- replace the name "apples" with your extension's name in :
   . configurations/setup.txt
   . ext_tables.php
   . and all class.*.php

- when you have a working extension with a minimal display on the 
frontend put all the code from your old extension into :
   . the controllers (the "brain" of the extension)
   . the models (staff that deals with the database)
   . the view (visual processing)
   . the templates (your html)
   . /libraries/additionnal_library.php


useful extension's code to study :

bananas (implement a model with transaction to the database)
cheries (formular generation)
efaq (use of ajax)

I also put the doxygen documentation of the lib / div on :

http://ecodev.ch/typo3doc/div
http://ecodev.ch/typo3doc/lib

very useful for development !

I don't recommend the Kickstarter__MVC *yet* as the generated code 
contains bugs and fatal error (at least for me...).



Stefan Geith a écrit :
> Hi There,
> 
> hope, this is the right newsgroup for this ...
> 
> 
> What is the way to convert exisiting plugins to MVC ?
> 
> If I understand it right, then my old plugins are some kind of
> 'controllers', but they also contain all that stuff for views and
> models. Right ?
> 
> 
> Then it could go this way:
> - copy old 'tx_plugin_pi1' to get my new 'controler'
> - replace all references to pi_base (e.g. pi_link...()) with
>   tx_lib_link etc.
> - change code, where necessary to let it work again
> - then extract all view-thingys to view-classes and all
>   model-related stuff to model-classes
> - and then do refactoring (until the end of days ...)
> 
> 
> Or should I do it better the other way round:
> - change my 'tx_plugin_pi1' to use tx_lib instead of pi_base
>   wherever possible
> - then extract all view-thingys to view-classes and all
>   model-related stuff to model-classes
> - do some refactoring
> - then copy old 'tx_plugin_pi1' to get my new 'controler'
> - change code, where necessary to let it work again
> - and then do refactoring (until the end of days ...)
> 
> 
> And what about my libraries:
> Should I create a plugin tx_mypersonal_lib where I put my stuff to new
> classes (and extend existing classes where it is reasonable) ?
> Maybe some parts of that could then go into the official tx_lib (if
> there is interest in it) ...
> 
> 
> -
> 
> Stefan


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