[eluser]djenniex[/eluser]
Actually, your models constructor can not accept argument in CogeIgniter, therefore, your going to have to change your code to something like this:
Code:
class abc extends Model
{
// Private Attributes
private $id;
private $name;
private $species;
private $weight;
private $colour;
// Constructor
public function __construct()
{
parent::Model();
}
public function initialize($id, $name, $species, $weight, $colour)
{
$this->id = $id;
$this->name = $name;
$this->species = $species;
$this->weight = $weight;
$this->colour = $colour;
}
etc ...
}
The you can use the Loader to load the model, and initialize it in the controller, ie.
Code:
<?php
class abc_controller extends Controller
{
private $xyz = array();
/**
* Constructor
*/
function __construct()
{
parent::__construct();
$this->load->model('abc');
$this->abc->initalize('1', 'name', '6', '1000', 'blue');
}
/**
* Default view
*/
public function index()
{
$data = array();
$this->load->view('abc_index', $data);
}
}