[TYPO3-dev] parse typoscript setup and constants for eID script
Simon Schaufelberger
schaufelREMOVE-MEberger at punkt.de
Tue Nov 8 17:43:51 CET 2011
Hi Oli,
thank you for that answer but that is not really what i want.
In my case i call an extbase plugin via ajax and therefor i don't need
any page related typoscript but only the typoscript (and constants) fot
that extension so i am independent of any page.
since there is STILL NO handy way in extbase to call an action via ajax,
i am using the ajaxDispatcher in pt_extbase:
https://github.com/michaelknoll/pt_extbase/blob/master/Classes/Utility/AjaxDispatcher.php
in which place in the core are the constants parsed? i didnt find that
place so far...
Am 08.11.2011 10:56, schrieb Oliver Klee:
> Hi,
>
> Am 08.11.2011 00:23, schrieb Simon Schaufelberger (Schaufi):
>> i have an eID script and want to parse typoscript there which works
>> perfectly fine so far but the only problem is that my *constants* don't
>> get replaced and i am looking for a way how to do that properly.
>
> 1. You can use the oelib extension for doing this very easily:
>
> // As TS setup is related to a particular page, we need to set it first.
> tx_oelib_PageFinder::getInstance()->setPageUid($pageUid);
> $configuration = tx_oelib_ConfigurationRegistry::get('plugin.tx_coffee);
>
> $fooStringConfigurationValue = $configuration->getAsString('foo');
> $barIntegerConfigurationValue = $configuration->getAsInteger('bar');
> $foobarBooleanConfigurationValue = $configuration->getAsBoolean('foobar');
>
> 2. Parsing a TS template is very expensive performance-wise. For an eID
> script which needs maximum performance, I'd recommend to move the
> settings to the EM (in the particular extension). This is much faster.
>
> There's also a convenient helper class for this in oelib;
>
> // The extension key needs to be without the "tx_" prefix.
> $configuration = tx_oelib_configurationProxy::getInstance('coffee');
> $fooStringConfigurationValue = $configuration->getAsString('foo');
> $barIntegerConfigurationValue = $configuration->getAsInteger('bar');
> $foobarBooleanConfigurationValue = $configuration->getAsBoolean('foobar');
>
> Hope this helps,
>
>
> Oli
--
Kind regards,
Schaufi from punkt.de
More information about the TYPO3-dev
mailing list