How Can I Use Language Class in Controller |
First of all, I made research but couldn't find anything about it.
I'm sending flash data to users when they update or add something. My controller file's related part is like this; Code: function hizmet_ekle() Code: <?php if($this->session->flashdata('ok')): ?> My system has a few different languages, it means I have to send different notification messages(session flashdata's) for each language but I can't use `lang` key in my controller file. How can I handle it? Thanks in advance.
Well... I think you should access flash data in the controller and not in the view.
And why can't you use the lang key in your controller?
Using the language helper you can just do something like: PHP Code: $this->session->set_flashdata('ok', lang('you_did_good')); in your language files you have the correct display for each language for the "you_did_good" key.
Website: marcomonteiro.net | Blog: blog.marcomonteiro.net | Twitter: @marcogmonteiro | TILThings: tilthings.com
|
Welcome Guest, Not a member yet? Register Sign In |