Language array file in "sub view" |
[eluser]henry178[/eluser]
Hi, this is mainteplate view: Code: <html> view/menu: Code: <ul> this is my controller: Code: $data['lang'] = $this->lang->load(DEFAULT_LANGUAGE, NAME_LANGUAGE); The problem is the language file.... is impossible to use the language array in menu view? Any solutions?
[eluser]danmontgomery[/eluser]
Why not just load the language helper and use lang() instead of lang[]?
[eluser]henry178[/eluser]
[quote author="noctrum" date="1308772526"]Why not just load the language helper and use lang() instead of lang[]?[/quote] another file language only for the menu?
[eluser]danmontgomery[/eluser]
[quote author="henry178" date="1308773952"]ah ok! ![]() http://ellislab.com/codeigniter/user-gui...elper.html[/quote] Yep. Just so there's no confusion for future visitors, rather than passing the language array to the view to try and access it directly, once the language file is loaded, you can access it with the language library with: Code: echo $this->lang->line('example'); You can also load language helper, and just use the lang() function: Code: echo lang('example'); In either case, it's unnecessary to pass the language array directly to the view. |
Welcome Guest, Not a member yet? Register Sign In |