[TYPO3-mvc] Sub folders inside folder Controller
    Patrick Lobacher 
    plobacher at n-o-g.de
       
    Sat Apr  9 08:07:43 CEST 2011
    
    
  
Hi Nico,
>  
> For instance I have an entity which is stored inside the folder
> "Classes/Domain/Model/Participants/Participant.php". Now I would like to create
> a controller for this entity which is placed under
> "Classes/Controller/Participants/ParticipantController.php". As fare as good.
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.
For the same reason there is no need to have a subfolder for your 
Controller as you have just one Controller for every Domain Model - so 
put all Controllers inside the Classes/Controller/ dir.
The paradigm behind Extbase is "Convention over Configuration" - so if 
you use the conventions everything works like a charm. Your approach (to 
create direcories just to contain a single class inside) brings no 	 
advantage at all - so it's better avoid it and use the given structure.
Bye
Patrick
> The only things I did, was moving the running "ParticipantController" from
> "Classes/Controller" to "Classes/Controller/Participants", perform naming
> corrections and reconfigure the plugin.
>  
> It seems that I can create and use sub folders inside my domain and repository
> packages but not inside controller.
>  
> Is it correct? Or what I did wrong?
    
    
More information about the TYPO3-project-typo3v4mvc
mailing list