[TYPO3-ect] General feedback for lib/div
Elmar Hinz
elmar.DOT.hinz at team.MINUS.red.DOT.net
Mon Jun 11 09:59:31 CEST 2007
> What IS correct?
> I call my diretories plural liek this
>
> controllers
> views
> models
> libs
> etc...
>
> then my files are called
> class.tx_sasda_view_sdaadsdas.php
> class.tx_sasda_model_sdaadsdas.php
> class.tx_sasda_controller_sdaadsdas.php
>
> I think I have sometimes seen that the filename is called plural like
> this:
> class.tx_sasda_views_sdaadsdas.php
> class.tx_sasda_models_sdaadsdas.php
> class.tx_sasda_controllers_sdaadsdas.php
Hi,
the automatic loader class uses the classname to find the pathes.
tx_sasda_views_sdaadsdas
matches
EXT:sasda/views/class.tx_sasda_views_sdaadsdas.php
If it differs (class.tx_sasda_view_sdaadsdas.php) the automatic loading
may fail. But you still have the possibility to use a classical require
method then.
My exprience has teached me to use plurals for things that are multiple
and singular for things that are single. That makes the code more easy to
read for myself and doubles the amount of names I have available. Example:
foreach($rows as $row) ....
So my choice is tx_specialextension_views_specialView.
There are muliple views in the views directory, but specialView is a
special one, so I name it singular.
Regards
Elmar
More information about the TYPO3-team-extension-coordination
mailing list