We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Accessing Global $LANG in mod.[module].php File

Development and Programming

Milsoft's avatar
Milsoft
27 posts
15 years ago
Milsoft's avatar Milsoft

I’m adding some error and debug logs to my module, and I want to store my error and debug messages in the language file to keep things clean.

I tried to use the following like I’ve used in the mcp.[module].php file, but the value seems to be empty.

global $LANG;
echo $LANG['my_message'];

Is the language file not loaded at that point? Is there a way to load it when I need it?

Thanks!

       
Manuel Payano's avatar
Manuel Payano
144 posts
15 years ago
Manuel Payano's avatar Manuel Payano

If you want to use language files in your “mod” file. You need to load them first.

$LANG->fetch_language_file('my_module');
       
Milsoft's avatar
Milsoft
27 posts
15 years ago
Milsoft's avatar Milsoft

Thank you very much! It worked very nicely.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.