Silex File Loader
An easier way to load php files in Silex 2., (*1)
Only load .php
file and no need to fill file extension., (*2)
Usage
Autoload whole directory:, (*3)
$app->autoload ('path/to/load');
Autoload whole directory after specified files loaded:, (*4)
$app->autoload (['load-file-a-first', 'load-file-b-first'], 'path/to/load');
Load files:, (*5)
$app->load (['php-file-a', 'php-file-b'], 'path/to/files');
Load files structurally:, (*6)
$app->load (['subpath' => ['php-file-a', 'php-file-b']], 'path/to/files');
Installation
Add in your composer.json
with following require entry:, (*7)
{
"require": {
"wake/Silex-File-Loader": "*"
}
}
or using composer:, (*8)
$ composer require wake/Silex-File-Loader:*
then run composer install
or composer update
., (*9)
Trait
class MyApplication extends Silex\Application {
use Silex\Application\FileLoaderTrait;
}
Feedback
Please feel free to open an issue and let me know if there is any thoughts or questions :smiley:, (*10)
License
Released under the MIT license, (*11)