Welcome Guest, Not a member yet? Register   Sign In
Object oriented CI
#6

[eluser]Spir[/eluser]
[quote author="Christer_" date="1336723699"]What i meen is that i want to do a instance class..

instead of doing

Code:
$this->user_model->get_name_by_current_user_id($this->session->userdata('userid'))
Or
Code:
$this->user_model->get_email_by_current_user_id($this->session->userdata('userid'))

i could just make a more personal side to another model witch says.
Code:
$this->user->email
$this->user->id
[/quote]
Code:
$this->load->model('user_model', 'user');
$this->user->function();
// or if your porperties are public :
$this->user->name = 'My name';
http://ellislab.com/codeigniter/user-gui...odels.html


Messages In This Thread
Object oriented CI - by El Forum - 05-11-2012, 12:48 AM
Object oriented CI - by El Forum - 05-11-2012, 01:00 AM
Object oriented CI - by El Forum - 05-11-2012, 01:03 AM
Object oriented CI - by El Forum - 05-11-2012, 01:07 AM
Object oriented CI - by El Forum - 05-11-2012, 01:08 AM
Object oriented CI - by El Forum - 05-11-2012, 01:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB