Skip to content

Latest commit

 

History

History
executable file
·
38 lines (34 loc) · 1 KB

README.md

File metadata and controls

executable file
·
38 lines (34 loc) · 1 KB

PSR-4 WordPress Plugin

WordPress Standard Plugin with Support PSR-4 autoloading.

PSR-4: Autoloader

This PSR describes a specification for autoloading classes from file paths. It is fully interoperable, and can be used in addition to any other autoloading specification, including PSR-0. This PSR also describes where to place files that will be autoloaded according to the specification.

Structure

In the below you can see the folder structure and classes:

includes
    ├── Folder
    │   └── Test.php
    └── Folder2
        └── Test2.php

The example of the Test.php

namespace Folder;

class Test
{
    /**
     * @return string
     */
    public static function getHelloWorld()
    {
        return 'Hello World!';
    }
}

And you can run above class in your code with below command:

echo Folder\Test::getHelloWorld();