My own classes and the code used everytime |
[eluser]Rvnikita[/eluser]
Hi! First off all thanks you very much because ofCodeigniter. I use it and i like it, but I have 2 questions: 1) I have some code, that I used everytime on site, for example some initial code, that i must call in every controller in every function (before the execution) Now I made a init model and in every controller first off all i call it Code: $this->load->model('init_m'); How can I wrote init code, that will be automaticly call before any controller? 2) I need some class, for example user class with different params and functions. Code: $user->name, $user->surname, $user->is_18_year_old() Thank's you very much and sorry for my english .(
[eluser]Colin Williams[/eluser]
Create a pre_controller hook: http://ellislab.com/codeigniter/user-gui...hooks.html
[eluser]Rvnikita[/eluser]
[quote author="Colin Williams" date="1225604759"]Create a pre_controller hook: http://ellislab.com/codeigniter/user-gui...hooks.html[/quote] OOh! Thanks you very very much! |
Welcome Guest, Not a member yet? Register Sign In |