[TYPO3-english] simply question about MTB/1

tom typostudy at gmail.com
Wed Nov 7 14:17:35 CET 2012


Hi,

Thanks.
Very clear explanation.

Tom

On Wed, Nov 7, 2012 at 3:27 PM, Jigal van Hemert <jigal.van.hemert at typo3.org
> wrote:

> Hi,
>
>
> On 7-11-2012 5:31, tom wrote:
>
>> <?php
>> class user_functions {
>>         /**      * Multiplies the current page ID with $conf["factor"]
>> */      function multiplyTest($content,$conf)   {
>> $currentPageUid =
>> $GLOBALS['TSFE']->id;           $factor = intval($conf['factor']);
>>                        return
>> $currentPageUid * $factor;      }}?>
>>
>> ...
>>
>> My question about this code is :
>>
>> what is $GLOBALS['TSFE'] and $conf['factor'])? And where can I get
>> defination of them? Thanks.
>>
>
> The snippet is probably a user function to demonstrate how you can run PHP
> from TypoScript.
>
> $GLOBALS['TSFE'] is the global instance of the class tslib_fe. This class
> is responsible for building the frontend of the website based on the
> TypoScript configuration.
>
> You can find this class in typo3/sysext/cms/tslib/class.**tslib_fe.php
>
> $GLOBALS['TSFE']->id is the uid of the current page. In this example this
> is just used for a demonstration, because it's obviously useless to
> multiply a pageid with a number :-)
>
> $conf is the TypoScript configuration of the current object. The TS of
> this example must have a property "factor" where you can set the number to
> multiply the page id with.
>
> --
> Jigal van Hemert
> TYPO3 Core Team member
>
> TYPO3 .... inspiring people to share!
> Get involved: typo3.org
>
> ______________________________**_________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**english<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english>
>


More information about the TYPO3-english mailing list