Welcome Guest, Not a member yet? Register   Sign In
Model naming conventions
#8

[eluser]the_fury[/eluser]
[quote author="louis w" date="1211526447"]What if you ive it a different name when loading it?

(from user guide)

Code:
$this->load->model('Model_name', 'fubar');
$this->fubar->function();
[/quote]

That won't do anything, 'fubar' would just be the variable name. Even though you're naming it 'fubar' it's still a 'Model_name' object.

take a look at Loader.php (CI_Loader.model) to see what's going on...

Code:
function model($model, $name = '', $db_conn = FALSE)
{
   ...
   $CI->$name = new $model();
   $CI->$name->_assign_libraries();
        
   $this->_ci_models[] = $name;    
}


Messages In This Thread
Model naming conventions - by El Forum - 05-22-2008, 01:57 PM
Model naming conventions - by El Forum - 05-22-2008, 03:03 PM
Model naming conventions - by El Forum - 05-22-2008, 03:42 PM
Model naming conventions - by El Forum - 05-22-2008, 05:10 PM
Model naming conventions - by El Forum - 05-22-2008, 08:07 PM
Model naming conventions - by El Forum - 05-22-2008, 09:16 PM
Model naming conventions - by El Forum - 05-22-2008, 11:22 PM
Model naming conventions - by El Forum - 05-22-2008, 11:34 PM
Model naming conventions - by El Forum - 09-10-2008, 12:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB