[TYPO3-core] RFC: #4155 / userFunc in conditions / t3lib_div::callUserFunction

Wolfgang Klinger wolfgang at stufenlos.net
Thu Sep 7 17:33:45 CEST 2006


 *hiya!*

 On Wed, 06 Sep 2006, Wolfgang Klinger wrote the following:
>  The attached patch uses t3lib_div::callUserFunction instead of
>  reinventing the wheel here.

 I found another problem here (don't know why it didn't come up
 by my first tests).

 includeLibs.something = something

 is processed after(!) the TypoScript template is parsed, so we have no
 such libraries (= classes) available at this time.
 All this happens in typo3/sysext/cms/tslib/index_ts.php
 (search for "getConfigArray", pagegen.php which does the inclusion is
 included afterwards)

 Example:
---------
includeLibs.mylib = EXT:user_mylib/mylib.php

[userFunc = user_mylib->test(param)]
# do something
[global]
---------
 will not work under all circumstances, as class 'user_mylib' may not be
 available at this point and is not automatically loaded
 (because there's no info from where to load it without the config array).

 The following two work:
---------
# function defined in localconf.php, this was the only form before
[userFunc = user_testfunc(params)]
# absolute path to extension, file, class, method
[userFunc = EXT:user_banner/test.php:user_test->testfunc(params)]
---------

 Is that sufficient?


 bye
 Wolfgang




More information about the TYPO3-team-core mailing list