[TYPO3-mvc] Sub folders inside folder Controller
Franz Koch
typo3.RemoveForMessage at elements-net.de
Sat Apr 9 10:36:30 CEST 2011
Hey,
> For what reason do you want to use subfolders in your Model? They just
> contain 1 file (the appropriate Domain Model Class) and so it makes no
> sense to store it there. Just put all Domain Model Classes inside
> Classes/Domain/Model and you are fine.
It's for sure working for models and I also use subfolders for models,
but only when I use single table inheritance. So my base model is in the
model folder and subtypes of this model reside in a according subfolder,
named like the base model:
Classes/Model/Resource.php
Classes/Model/Resource/Document.php
Classes/Model/Resource/Video.php
Classes/Model/Resource/Image.php
...
The class names have to reflect that of course:
Tx_Ext_Domain_Model_Resource
Tx_Ext_Domain_Model_Resource_Document
...
There is of course no need to do that, but for me it's easier to keep
track of which model belongs to which type in larger projects.
For controllers it might be useful on some larger projects with tons of
controllers that could be grouped by their task/plugin, and the
autoloader shouldn't have any issues with this, but as it seems the
plugin registration.
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list