- File NamingClass files must be named in a Ucfirst-like manner, while any other file name (configurations, views, generic scripts, etc.) should be in all lowercase.INCORRECT:somelibrary.phpsomeLibrary.phpSOMELIBRARY.phpSome_Library.phpApplication_config.phpApplication_Config.phpapplicationConfig.phpCORRECT:Somelibrary.phpSome_library.phpapplicationconfig.phpapplication_config.phpFurthermore, class file names should match the name of the class itself. For example, if you have a class named Myclass, then its filename must be Myclass.php.
Class and Method Naming
Class names should always start with an uppercase letter. Multiple words should be separated with an underscore, and not CamelCased.INCORRECT:class superclass
class SuperClass
CORRECT:class Super_class
class Super_class {
public function __construct()
{}}Class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names. Multiple words should be separated with an underscore.INCORRECT:function fileproperties() // not descriptive and needs underscore separator
function fileProperties() // not descriptive and uses CamelCase
function getfileproperties() // Better! But still missing underscore separator
function getFileProperties() // uses CamelCase
function get_the_file_properties_from_the_file() // wordy
CORRECT:function get_file_properties() // descriptive, underscore separator, and all lowercase letters
codeIgniter Codeigniter php frameworks will teach you about codeigniter URLs. If you not understand about installing codeigniter, please follow the previous post . The codeigniter URLs feature is designed to be search engine and human friendly. For the example is example.com/ news / article / my_article . Firstly is URI Segment, the segment in the URL is following with the Model-View-Controller(MVC). And for the structure is example.com/ class / function / ID . Class is the first segment represents the controller class that should be invoke. Function is the second segment represents the class function, or method, that should be called. And ID is the third, and any additional segment, represents the ID and any variables that will be passed to the controller. For the second learn about codeigniter URLs is How to removing the index.php. what is index.php? index.php is the main file to default appear to your URL. The actually codeigniter URL is example.com/ index....
What if we write in capital ..??? Does it throws error or fails. ?
ReplyDeleteit throws error............
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletekkk , you solved my big problem (y) yhanks alot man :D
ReplyDelete