[TYPO3-dev] Reading ts-setup in php

Steffen Kamper steffen at sk-typo3.de
Mon Jun 25 15:02:11 CEST 2007


"Tonni Aagesen" <goes.to at dev.null> schrieb im Newsbeitrag 
news:mailman.1.1182774792.13614.typo3-dev at lists.netfielders.de...
> Steffen Kamper wrote:
>
>>> Firstly, I need to read some ts-setup from some arbitrary php code, and 
>>> I'm uncertain how to do this correctly. I _can_ do it like this:
>>>
>>> $tx_foobar_ts = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_foobar.']
>>
>> this is correct if you have the TSFE-Object
>
> Thanks - so if I don't have the TSFE-Object, is there another way?
>
>

simple example:

require_once(PATH_t3lib.'class.t3lib_tsparser_ext.php');
require_once(PATH_t3lib.'class.t3lib_page.php');

$template = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global 
here!
$template->tt_track = 0;
// Do not log time-performance information
$template->init();
$sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
$rootLine = $sys_page->getRootLine($pid);
$template->runThroughTemplates($rootLine); // This generates the 
constants/config + hierarchy info for the template.
$template->generateConfig();//
$conf = $template->setup['plugin.']['tx_yourext.'];

vg  Steffen 






More information about the TYPO3-dev mailing list