Welcome Guest, Not a member yet? Register   Sign In
Naming convention for M V C including file names
#21

[eluser]bengrice[/eluser]
ow and phil sturgeon

just on the off chance these were aimed at me:

Quote:Don't you just love it when idiots sign up to forums and pick fights with 3 year long users with post-counts nearing 3k?

Quote:The world is full of stupid f**ks and sometimes I use them for my own amusement I guess. I love it when they think I care

Quote:And I had all the same dumb questions when I started, but I knew I was a moron so I remained humble and diligent

id take your own advice advice:

Quote:Next time I'll avoid the whole shit-storm and just answer the question

and as quoted from one of your previous comments, with comments like that mate, you still are...

Thanks all

Ben
#22

[eluser]Phil Sturgeon[/eluser]
Only the first one was me. :-P
#23

[eluser]Johan André[/eluser]
Haha! This thread is entertaining! Smile
#24

[eluser]Jonny5ive[/eluser]
I have just started on CI and also looking for some guidance on this. Here is my example with names based upon those given in the user guide:

Controller class: pages
Controller filename: pages.php

Model class: pages_model
Model filename: pages_model.php

View filename: pagesview.php

Would it be better to have all the file names as pages.php or is it better to make them distinct (and more identifiable) by using pages_model.php or _view_model.php?

Just wondering what naming conventions other people use.... Tongue
#25

[eluser]jeephnx[/eluser]
It's easy to miss in the chaff, but I found that if you are loading a system library from a module controller you MUST ensure you capitalise the first char of the library name e.g. $this->load-library('Email'). The loader in system/models/libraries is case tolerant but the loader used by the module library im using (webber)is not. Wasted hours trying to get a library to load on a linux box!
#26

[eluser]Colin Williams[/eluser]
jeephnx, that's a good bug to report to Webber, if that project is still active. Extensions to CI should never break conventions.




Theme © iAndrew 2016 - Forum software by © MyBB