- 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: Getting Started With a Simple Example Introduction CodeIgniter is a powerful PHP framework that can help you greatly speed up the development of your web applications. It is has a small performance footprint due to the modular approach to loading its libraries and does a great job separating logic from presentation by using a Model-View-Controller (MVC) dynamic. In this tutorial, you will learn how to create a very simple application that displays content from the database. It is not meant to provide the solution to building your own CMS, but rather to illustrate how CodeIgniter can be used. Additionally, it seeks to put in practice some of the lessons learned in the previous article and assumes you already have CodeIgniter installed on your development environment and have configured it as described in the first tutorial. The Plan In this article, you will see how to use some of CodeIgniter’s classes and functions to query a database table c...
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