directory and file naming directories and filenames are lowercase + underlined and start with lowercase letters; class libraries, The function file is unified with. php suffix, the file name of the class is defined in the namespace, and the path of the namespace is consistent with the path of the class library file (including case), the class name and class file name are consistent, and uniform use of the camel name (first capitalization) class, method and property naming class named Using Hump method, and the first letter capitalization, such as user, usertype; method name using Hump method, and the first letter lowercase or use underscore "_", such as getusername,_parsetype, usually the method of the beginning of the underscore is a private method, the name of the property using the Hump method, and the first letter lowercase or use underscore "_", for example TableName, _instance, the attribute usually beginning with underscore is private property; a function or method preceded by a double underscore "__" as a magic method, such as __call and __autoload A function named function is named using lowercase letters and underscores (beginning with lowercase letters), such as get_client_ip; constant named constants are named with uppercase letters and underscores, such as App_debug and App_mode; Configure named configuration parameters to be named with lowercase and underscores, for example url_route_on; Data table and field named Data tables and fields are named in lowercase and underlined, and note that field names do not begin with an underscore, such as the Think_user table and User_name fields, which are likely to be filtered by a data table field like _username. Apply the Class Library namespace specification to apply the root namespace of the class library uniformly to the app (you can set app_namespace changes); For example: App\index\controller\index and App\index\model\user.
thinkphp Naming conventions