Laravel-what should the standard php class library name look like?

Source: Internet
Author: User
I have seen many open-source projects as class. class name. php. class. php: where is the position of this class suitable? I personally respect it. class. php format, because in this way, after a third-party class library is imported to a specified class library in some frameworks... I have seen many open-source projects as class. class name. php. class. php: where is the position of this class suitable?

I personally admire the form of. class. php, because in this way, you can import a third-party class library in some frameworks and specify the class library suffix as. class. php.

Reply content:

I have seen many open-source projects as class. class name. php. class. php: where is the position of this class suitable?

I personally admire the form of. class. php, because in this way, you can import a third-party class library in some frameworks and specify the class library suffix as. class. php.

  • *. Config. php

  • *. Function. php

  • *. Class. php

The above is suitable for small code use, and everything is lost in a directory.
If not, such a file name is not required.

Recommended to understand the php psr-4: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md

This is a habit problem, or followPSR-4After all, there arecomposerAutomatically generates mappings between namespaces and source files.

I personally think that if it is a php file
That's the end of php.
No need to differentiate the class file configuration file function files
For more information, see the items on the top of http://packagist.org/
It should end with php!

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.