PHP Code Description

Source: Internet
Author: User
I. File naming rules: 1: The class file name ends with. class. php. For example, Helper. class. php2: A class file only defines one public class, and the file name is the same as the class name. For example, in the Helper. class. php file, publicclassHelper {spanstylewhite-space: prespan...} 3: The function library file name is closed in. func. php.

I. File naming rules: 1: The class file name ends with. class. php. For example, Helper. class. php 2: A class file only defines one public class, and the file name is the same as the class name. For example, in the Helper. class. php file, public class Helper {span style = white-space: pre/span...} 3: The function library file name is closed in. func. php.

I. File naming rules:

1: The class file name ends with. class. php. For example, Helper. class. php

2: A class file only defines one public class, and the file name is the same as the class name. For example, in the Helper. class. php file,

public class Helper {
....
}
3: The function library file name ends with. func. php. For example, global. func. php

4: the configuration file is named config. php. [of course, it must be determined based on the current development context]

Ii. Method naming rules:

1: Name the function library method: it is all lowercase + underline, verb + noun. For example: function get_users (){}

2. class-based naming: The camper naming method is used: Verb + noun. For example, function getName (){}

3: class private method naming: Using underline + camper: Verb + noun. For example: function _ listToTree (){}


Iii. variable naming rules:

1: class attributes: named after the hump, $ templateFile

2: internal variables of the method: Type + lowercase + underline, for example, $ ashop_result; (representing the array returned by the shop Table query)

F (floating point number), s (string), a (array), B (Boolean value), I (integer number), o (Instance Object ).


Iv. Writing specifications:

1: The left parentheses of braces do not occupy one row independently, and the right parenthesis occupies one row independently and the subject is at the same level.

2: if-else must be wrapped in.

3: four spaces are used for indentation. (A tab must represent four spaces)






The above is only the code specification that I use for my own time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.