Welcome Guest, Not a member yet? Register   Sign In
How can I know if a model exist
#2

I answer myself just in case anyone have the same problem

Just add a modification in MY_Model constructor

if(!empty($tatic::$table_name)
static::$fields = get_fields();

After that, add a set_data($table) function

And there we go:

if(!class_exist(ucfirst(static::$prefix) . 'M'){

$this->load->model('nomenclators_m');
$this->nomenclators_m->set_data(trim(static::$prefix, '_'));
Reply


Messages In This Thread
How can I know if a model exist - by Omar Crespo - 09-05-2020, 08:38 AM
RE: How can I know if a model exist - by Omar Crespo - 09-05-2020, 10:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB