Reputation: 65
I have these models:
class Content_model extends MY_Model{
public function __construct()
{
$test='main_content';
parent::__construct($test);
}
}
class MY_Model extends CI_Model {
public function __construct($recived_parameter) {
parent::__construct ();
// do something with $recived_parameter
}
}
I want to pass the argument $test
to MY_Model's construct, but nothing seems to be recived. Any ideas?
Upvotes: 1
Views: 92
Reputation: 672
smth like this might work
class Content_model extends CI_Model{
protected $param = "Haloo";
public function __construct()
{
parent::__construct();
}
}
class MY_Model extends Content_model {
public function __construct() {
echo $this->param;
}
}
Upvotes: 1