I just want to know on how to pass parameters in module constructor?
Here is the code that is wrote but its not functioning well.
//Here is the main controller
class Main extends MX_Controller
{
public function _construct()
{
parent::_construct();
}
public function index()
{
// sample parameter
$aparam = array(
'param1' => 'param value1',
'param2' => 'param value2'
);
$this->load->module('dashboard',$aparam);
}
}
// Here is "dashboard" module controller
class Dashboard extends MX_Controller
{
public function __construct($aparam)
{
//output param value
// want to get this value
echo $aparam['param1'];
echo $aparam['param2'];
}
}
Please help. thanks.