[TYPO3-english] Hot to get to constats.txt in plugin
Dawid Pacholczyk
dpacholczyk at gmail.com
Tue May 4 09:07:54 CEST 2010
Hi,
Thx for the answer. I found the solution about midnight. But realy thanks
for your time.
Best regards,
Dawid Pacholczyk
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Dawid Pacholczyk
tel: 502-054-334
gg: 5564051
skype: dpacholczyk
http://typo3blog.pl (only polish version at the moment)
-----Original Message-----
From: typo3-english-bounces at lists.typo3.org
[mailto:typo3-english-bounces at lists.typo3.org] On Behalf Of Jigal van Hemert
Sent: Tuesday, May 04, 2010 9:02 AM
To: typo3-english at lists.typo3.org
Subject: Re: [TYPO3-english] Hot to get to constats.txt in plugin
Dawid Pacholczyk wrote:
> How to get to file constants.txt ?
>
> In BE everything is fine. I can go into constant editor and edit this
value.
>
> But how to get it in the php script, in main class of the extension ? The
> class extends tslib_pibase and I tried to get it via $conf variable.
> Unfortunately this didn`t give me any results.
These constants are meant to be used in TypoScript. So, if you use them
in your setup.txt then they are available in $conf in your extension.
The point of having constants is that they can be easily changed in the
constants editor by administrators who find TypoScript a bit complicated.
constants.txt:
plugin.tx_myext_pi1 {
# cat=plugin.tx_somename_pi1; type=int; label= Storage ID
storageID = 0
}
setup.txt:
plugin.tx_myext_pi1 {
storageID = {$plugin.tx_myext_pi1.storageID}
}
Remember to call
t3lib_extMgm::addStaticFile($_EXTKEY, 'path/to/constants/and/setup/',
'My extension and other description of static template');
in ext_tables.php
Then you can read $conf['storageID'] in your extension script.
--
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list