Load Language from within an own Library |
[eluser]codeworxx[/eluser]
Hey Guys, i have created my own Language File and my own Class in the application/libaries Folder. The Language is defined in the Configuration File and Autoloaded! I have access to the File through the Views - there's no Problem, but when i try to access the Language File through my Libaries Class, i get an Error!! How to fix that? In my own Library Class i have to define a Standard Message - and this one depends on the Language, so i need access to the File. Hope everyone understands what i mean??? Greetings from Germany, Sascha
[eluser]pistolPete[/eluser]
Please post the code of the library. Which error do you get?
[eluser]codeworxx[/eluser]
Okay, that's the code of the Library: Code: class Displayerror An this is the Error: Quote:A PHP Error was encountered Line 19 is that line: Code: if( empty( $message ) ) $message = $this->lang->line( 'error_undefined' ); Thanks, Sascha
[eluser]cahva[/eluser]
If thats the whole code, yoy forgot to use get_instance() so that you can use CI libraries. This can be found in the user guide For example: Code: class Displayerror
[eluser]codeworxx[/eluser]
oh man... thank you so much... Think it was toooo late yesterday. Have used get_instance 2-3 Times and just forgotten. Thanks, Sascha |
Welcome Guest, Not a member yet? Register Sign In |