CodeIgniter Forums
model names - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: model names (/showthread.php?tid=6632)



model names - El Forum - 03-06-2008

[eluser]zilverdistel[/eluser]
I noticed during development that when loading a model, e.g.
Code:
class Gebruiker extends Model
, it doesn't matter if I use
Code:
$this->load->model('Gebruiker');
or
Code:
$this->load->model('gebruiker');
.

I like that, but I don't find any specific information about this in the manual. What I'd like to know is if I can keep on using lower-case, or if this should be considered a 'bug'. In the latter case, I'd prefer not to further exploit this 'feature'.


model names - El Forum - 03-06-2008

[eluser]wiredesignz[/eluser]
It's not a bug, all filenames except CI libraries should be lowercase, while the Class names and CI library filenames are ucfirst.

The name you type is converted to lowercase and then the loader checks for this and also for the ucfirst version of it.

Hope this helps.


model names - El Forum - 03-06-2008

[eluser]xwero[/eluser]
The load model method looks for the file with the name you defined in the first argument. You can use the capital first letter but it gets transformed to lowercase letters. So you can use it any way you want.


model names - El Forum - 03-06-2008

[eluser]zilverdistel[/eluser]
ok, i get it. Thanx.