model($model[, $name = ''[, $db_conn = FALSE]])
Parameters: |
|
---|---|
Returns: |
CI_Loader instance (method chaining) |
Return type: |
CI_Loader |
1 | $this ->load->model( 'model_name' ); |
If your model is located in a subdirectory, include the relative path from your models directory. For example, if you have a model located at application/models/blog/Queries.php you’ll load it using:
1 | $this ->load->model( 'blog/queries' ); |
If you would like your model assigned to a different object name you can specify it via the second parameter of the loading method:
1 2 | $this ->load->model( 'model_name' , 'fubar' ); $this ->fubar->method(); |
Please login to continue.