[Typo3-dev] $LANG is always NULL

Brian Slezak Brian.Slezak at cor.org
Thu Aug 4 22:55:42 CEST 2005


I had the same thing you did, and posted about an empty admin panel. Screwy things happen when you try to use $LANG from the front-end. 

$LANG is a backend-only object.  You can't use it in the front-end.

It's not completely clear in the 'Inside Typo3' document, that this is speaking to Backend only.
http://typo3.org/documentation/document-library/doc_core_inside/How_to_acquire_label/

I can't find the documentation on it, but you need to use the following lines:

// This loads the locallang.php file located in EXT:ext_key/pi1/locallang.php
$this->pi_loadLL();

// Access labels through this function
$label = $this->pi_getLL('missing_').$check;

Example:
http://typo3.org/documentation/document-library/form_extension_tut/class_user_test_pi1/?encryptionKey=&cHash=5aae6da5d0

Brian Slezak

> I need it for this:
> 
> $label = 
> $LANG->sL('LLL:EXT:sr_feuser_register/pi1/locallang.php:missin
> g_'.$check);
> 
> 
> This extension has error messages for feuser which are needed also in 
> tt_prodcuts to diplay a text message for the fe_user field 
> which has not 
> been filled in.
> 
> 
> Franz




More information about the TYPO3-dev mailing list