function or plugin that can retrieve asset ? |
[eluser]runrun[/eluser]
Hi, My error messages, email messages and notice messages is increasing quickly, I wonder If i can put all the messages in a file, and use a function or class to retrieve it in controller. As the long last message is making controller hard read thoroughly.
[eluser]TheFuzzy0ne[/eluser]
I'm not sure what you mean. Can you give an example?
[eluser]runrun[/eluser]
Somewhere in file system, we have a file asset.php that contains such thing: Code: $email_message['register_success'] = 'Dear user, congratulation, you have successfully created an account please activate your account...feel free to contact us if you have problem. Support team.'; Controller: Code: $user_email = [email protected];
[eluser]jacobc[/eluser]
You could create email views perhaps... For the body of the messages. So do $this->email->message($this->load->view('email/registration',$data,true)); Then you can pass any data and do the body of the message in a view file.
[eluser]TheFuzzy0ne[/eluser]
I'm wonderng if your asset.php may be better off as a language file.
[eluser]xwero[/eluser]
The problem i have with one time messages like activation_confirm in the above code is that you usually have to store them in a file with unrelated messages. A possible solution is this Code: // config.php The functionality could be made more like the language class works now but then you have to load the file every time. Code: // MY_Language.php |
Welcome Guest, Not a member yet? Register Sign In |