PHP code example of alleyinteractive / wordpress-autoloader

1. Go to this page and download the library: Download alleyinteractive/wordpress-autoloader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alleyinteractive / wordpress-autoloader example snippets


Alley_Interactive\Autoloader\Autoloader::generate(
	'Plugin\\Namespace',
	__DIR__ . '/src',
)->register();

// Or register the autoloader manually.
spl_autoload_register(
	Alley_Interactive\Autoloader\Autoloader::generate(
		'Plugin\\Namespace',
		__DIR__ . '/src',
	)
);

src/class-example-class.php -> Root_Namespace\Example_Class
src/trait-reusable-feature.php -> Root_Namesace\Reusable_Feature
src/feature/class-example-feature.php -> Root_Namespace\Feature\Example_Feature