[TYPO3-dev] Get extKey from classname
Steffen Kamper
info at sk-typo3.de
Fri Aug 22 13:01:26 CEST 2008
Dmitry Dulepov [typo3] schrieb:
> Hi!
>
> Steffen Kamper wrote:
>> yes, but underscore is extracted (not reproducable) and the ending is
>> free too ("_pi1" as default, but can also be "controller" or anything
>> else.
>
> function getKeyByClassName($className) {
> foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $key => $data) {
> if (substr($className, 0, strlen($data['classPrefix']])) ==
> $data['classPrefix']) {
> return $key;
> }
> }
> return false;
> }
>
> Now the only task is to set classPrefix to $GLOBALS['TYPO3_LOADED_EXT'].
>
Hi Dmitry,
great! I will test, and if test is positive i make a patch with it.
Thanks for your work!
vg Steffen
More information about the TYPO3-dev
mailing list