[Typo3-dev] getting values from locallang_db.php for frontend output

JoH info at cybercraft.de
Tue Jun 21 17:07:08 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?
>
> it is definitly in t3lib_div as of 3.8
>
> if u use it in FE make sure to do a
> 'require_once(t3lib . 'class.t3lib_div.php'); or something like this.
> t3lib_div is afaik not available in FE by default?

Well - since this line works
$this->getVars = t3lib_div::_GET();
class.t3lib_div.php should be available.

And I already got a working function call with:
$labels = $GLOBALS['TSFE']->readLLfile('EXT:locallang_db.php');

But there must still be something wrong with the syntax for the file/path
since the result is an empty array although there is something defined in
locallang_db.php

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