[TYPO3-mvc] own extension library

Felix Oertel mehl at foertel.com
Wed May 5 12:41:19 CEST 2010


Hey,

Am 05.05.10 12:18, schrieb Daniel Dimitrov:
> I'm wondering about the following thing. When we write extensions we
> often need to write functions that we use in several models.

Do you mean controllers?

> Where is the best place to place those functions?
> in Resources/Private/functions/... ?

I - personally - would place them in Classes/Helper/...

> Also what would be the best way to register those functions for use in
> my extension?

You could build them static and use Tx_YourExt_Helper_Topic::method() or 
just build them normal and instantiiate the class where you need it.

> I don't think that require(filename) everywhere I need a
> function is the best way to do this.

Both ways mentioned above you don't have to require the file manually 
because TYPO3 and extbase come with an autoloader which cares for your 
files (if you name them right).

regards, foertel


More information about the TYPO3-project-typo3v4mvc mailing list