[Typo3] General Approach for Finding Typo3 Classes/Methods

Christian Trabold trabold at mehrwert.de
Thu Aug 11 10:23:17 CEST 2005


Hello Nick,

> What is your approach when you are trying to work with Typo3 classes, 
> but you don't know where the function (method) you are looking for is 
> located and how it is called?
> 
> I've just been looking for a method that returns the path to an 
> extension folder. I remember that there was a method particularly for 
> that purpose, but I can't find it anymore. At least neither in 
> class.tslib_pibase.php nor in class.t3lib_div.php.
> 
> Any pointer as to what would be the best (general) approach for finding 
> specific methods would be really appreciated.

1. experience. By and by you'll get the concept of how TYPO3 works 
inside and which file or class stands for.


2. browse the source. Have a look at the included files to go deeper. 
The source code is well documented and things should clear up soon.


3. Have a look at
http://typo3.org/documentation/document-library/doc_core_api/
and
http://typo3.org/documentation/document-library/doc_core_inside/


4. Install the Extension Development Evaluator-Extension (extdeveval)!
It's a must for developers and enables a nice API-Documentation-Frame.




Now for your problem with the extension path I would suggest the following:

Analyze the file "ext_tables.php" of an extension you like (tt_news is 
good ;) ).

Have a look on how the paths are generated. You'll find code like that:

t3lib_extMgm::extRelPath($_EXTKEY)

Now, if you want to get more infos on this method, do this:

1. Have a closer look on how the function is called:
t3lib_extMgm::extRelPath($_EXTKEY)
                           ^------ the extension-key ;)
                ^------ the methods name, search for that in the file
        ^------ it is class.t3lib_extmgm.php
^----- it's in folder 't3lib' (t3lib = TYPO3 Library)

2. read the description of the function extRelPath in file 
class.t3lib_extmgm.php.


Just my 2 cents.

Hope that helps a bit.


Greetings,

Christian



More information about the TYPO3-english mailing list