[TYPO3] getting constants in an FE plugin extension

Simon Child simon at srchild.com
Thu Sep 18 00:27:53 CEST 2008


"Dmitry Dulepov [typo3]" <dmitry at typo3.org> wrote in message 
news:mailman.1.1220336897.3558.typo3-english at lists.netfielders.de...

> Simon Child wrote:

>> How do I retrieve the values of some constants set on current page 
>> extension template or on the root page main template, when coding a FE 
>> plugin?

> You can assign constants to TS properties and acces them this way. For 
> example:
>
> plugin.tx_extkey_pi1 {
> prop = {$const}
> }
>
> You will get the value of the "const" as $this->conf['prop'] in the 
> plugin.

Thanks that works. But it seems strange to have to assign a constant to a 
property in setup, before being able to read it in php. Is there no way to 
access constants directly from php, without first assigning them to TS 
properties?

(Just curious, the above will work fine for me).

TIA.

-- 
Simon Child 




More information about the TYPO3-english mailing list