[Typo3-dev] getting values from locallang_db.php for frontend output
JoH
info at cybercraft.de
Tue Jun 21 16:36:19 CEST 2005
>>> The question is: What is the preferrable way to insert labels from
>>> locallang_db.php into the output of the FE-plugin(s)?
>>
>> t3lib_div has something for everyone:
>>
>> t3lib_div::readLLfile($fileRef,$langKey) seems to be the right way.
>>
>
> unfortunately this seems to be part of $lang for the backend but it
> is not available via t3lib_div::readLLfile
> (Or has this changed from 3.7 to 3.8? - We are using 3.7 with this
> project) Using the function in the PHP code of the plugin gives us
> the following error message:
> Call to undefined function: readllfile() ... blah
>
> Searching the different sections of extdeveval I found out that there
> is something like "function readLLfile($fileRef)" in
> sysext/lang/lang.php but as far as I understood this can't be used
> inside FE-plugins.
> Any other ideas?
With a bit of searching and testing I got the correct function call now:
$labels = $GLOBALS['TSFE']->readLLfile('EXT:locallang_db.php');
There is only one parameter for the file to be read by this function.
As far as I understood this should give me an array with the keys and values
of "local_lang" if this is found.
But using debug($labels) I always get an empty array which leads me to the
conclusion that there must be something wrong with EXT:locallang_db.php ...
But we are getting closer.
Joey
--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau
More information about the TYPO3-dev
mailing list