[TYPO3-mvc] own extension library

Daniel Dimitrov danielsd_bg at yahoo.fr
Thu May 6 09:37:18 CEST 2010


Hey Felix,
I placed an Utilities.php in Classes/Helper/ and then I used 
Tx_MyExt_Helper_Utilities::method()
and it worked like a charm! Thank you for this!

The next thing that bothers me: for the pagination I have written a small 
ViewHelper - I'm going to use this viewHelper
in most of my extensions. Is there any way to use my viewHelpers in other 
extensions, too? Or do I have to manually copy
them to the Classes/ViewHelper folder of all my extensions?

Kind Regards,
Daniel

"Felix Oertel" <mehl at foertel.com> wrote in message 
news:mailman.1.1273056304.9248.typo3-project-typo3v4mvc at lists.typo3.org...
> 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