| Start |
|---|
| PSR-4: Autoloader PSR-4 (opens new window) is an accepted recommendation that outlines the standard for autoloading classes via filenames. This recommendation is recommended as the alternative to the earlier (and now deprecated) PSR-0 (opens new window). The fully qualified class name should match the following requirement:
Thus the final class name would be Starting with PHP 5.3.0, a custom autoloader function (opens new window) can be defined to load files based on the path and filename pattern that you define. Replacing the location ('classes/') and filename extension ('.class.php') with values that apply to your structure. Composer (opens new window) package manager supports PSR-4 (opens new window) which means, if you follow the standard, you can load your classes in your project automatically using Composer's vendor autoloader. Regenerate the autoloader file Now in your code you can do the following: |
| PSR-1: Basic Coding Standard PSR-1 (opens new window) is an accepted recommendation and outlines a basic standard recommendation for how code should be written.
|
| PSR-8: Huggable Interface PSR-8 (opens new window) is a spoof PSR (currently in Draft) proposed by Larry Garfield (opens new window) as an April Fools joke on 1 April 2014. The draft outlines how to define an interface to make an object Excert from the code outline: |
Read Article
https://develop.horje.com/learn/1434/reference