Hello,
I would like to know what is the best practice to define class members in a CodeIgniter model?
Thank you.
Hello,
I would like to know what is the best practice to define class members in a CodeIgniter model?
Thank you.
You can place member variables and funciton in a model like in any php class.
A very simple example of a CI Model:
class sample_model extends Model {
// private member variable
private var $sample_arr;
// public constructor
public function __construct()
{
// call parent constructor
parent::__construct();
// init sample array
$sample_arr = array();
}
}
More Info about classes in php http://www.php.net/manual/en/language.oop5.basic.php