[eluser]lezeroq[/eluser]
Maybe someone is still interested in this issue. You can modify system library system/libraries/Loader.php, replace
Code:
function model($model, $name = '', $db_conn = FALSE)
{
//...
//...
$CI->$name = new $model();
$CI->$name->_assign_libraries();
$this->_ci_models[] = $name;
}
with
Code:
function model($model, $name = '', $db_conn = FALSE)
{
//...
//...
if (func_num_args() > 3) {
$refl = new ReflectionClass($model);
$CI->$name = $refl->newInstanceArgs(array_slice(func_get_args(), 3));
} else {
$CI->$name = new $model();
}
$CI->$name->_assign_libraries();
$this->_ci_models[] = $name;
}
Example model with arguments in construcrot:
Code:
class ExampleModel extends Model {
function __construct($param1, $param2)
{
parent::Model();
// do some with params
}
//...
}
Now you can pass yours parameters from controller to a models constructor after the first three arguments
Code:
$this->load->model('ExampleModel', '', FALSE, $param1, $param2);
Sorry for my enslish