Welcome Guest, Not a member yet? Register   Sign In
Is there are any strict naming convension in codeigniter?
#1

[eluser]Sumon[/eluser]
Hi all,

I am newbie in CodeIgniter world.Would you please let me know is there are any naming convension to define a variable, constant, function, class(controller, model, view) or anything what right now i don't know in CodeIgniter. Let me know these points so that i can start smoothly.

Thanks,
Aminul
[Newbie in Codeigniter.]
#2

[eluser]BravoAlpha[/eluser]
http://ellislab.com/codeigniter/user-guide/toc.html
#3

[eluser]Phil Sturgeon[/eluser]
CI is fairly flexible in its naming. You will have to be careful on the cases when writing libraries and controllers, but most of it is insensitive. There are very few variables for you to worry about, but think what you are doing when you chose model or constructer properties.

For example if you call a class property validation or load it will clash with the classes Validation and Load. That is the only real conflict you will find.

Oh and dont name a page "view" in PHP4. ^_^
#4

[eluser]Sumon[/eluser]
thanks for your link. would you please let me know exact link / topic where from i shall get specific answer about naming convention in CodeIgniter.
#5

[eluser]xwero[/eluser]
Classes have a first uppercase character and lowercase for the rest of the word. For methods/filenames the words/parts are split with an underscore and they are all lowercase. I think that's about it for naming conventions.
#6

[eluser]Lone[/eluser]
We have been getting into the method of using underscores '_' between words in functions and camelCase for variable names after someones recommendation in here.
#7

[eluser]Derek Allard[/eluser]
If you look on the bottom of the controllers page you'll find a list of reserved words. Other then that, you're pretty free to make any choices you want.




Theme © iAndrew 2016 - Forum software by © MyBB