I am trying to solve a tricky problem.
I am creating a project, which requires more than one language. So I have created files for all the languages, with an array of the language.
Now the problem is, I am using my own MVC system.
Basically, in my init file, I want to include a language file, which include the correct language, that works perfectly.
The problem appears, when I wanna show it in a view.
When I have my controller call the view class and render the view, it is in a class, making the variables outside the class unavailable.
I can solve this problem by including my language file, in the view renderer class, but since I sometimes need to set the variables in a model, its not working.
Anyone have some ideas?
Possibly the easiest way is to make the language variable global: In your included language file, use
and start your view methods with
global $LANGUAGE;also.