Skip to content

WordPress Standard Plugin with Support PSR-4 autoloading.

License

Notifications You must be signed in to change notification settings

KingMatrix1989/PSR4-WordPress-Plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

WordPress Standard Plugin with Support PSR-4 autoloading.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages