[eluser]Christer_[/eluser]
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
but i believe the right way to do this is to make a model "User.php"
and just autoload it with
Code:
class User extends CI_Model {
function __construct()
{
if ($this->session->userdata('userid'))
{
$id = $this->db->query
e.e
}
}
}
or am i completly missing som points in the mvc pattern here?
The reason why i am askin is because someone says i need to extend the CI_Controller with a MY_Controller and go from there.
Someone else means its a library since it contains user information
Someone, aswell as myself meens it should be model as there is DB interaction and it is to be used within the controller directly.