CodeIgniter Forums
quick question about controller-model - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: quick question about controller-model (/showthread.php?tid=45310)



quick question about controller-model - El Forum - 09-16-2011

[eluser]Wondering Coder[/eluser]
Hi guys,

just want to ask how to throw a variable in model in the __construct() area.

Suppose I have this in my controller
Code:
controller function
{
..
$item = $this->uri->segment(3); //the value of this to be fetch to my model construct
..
}
My model
Code:
class User extends CI_Model {

    function __construct()
    {
        parent::__construct();
                //what to put here????
    }

or is this possible?