vonalbert / silext
Extensions for the silex framework
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/vonalbert/silext
Requires
- php: >=5.3.0
- silex/silex: 1.*
This package is not auto-updated.
Last update: 2025-10-25 23:58:49 UTC
README
SilEXT is an extension library for the silex microframework.
Installation
Just add vonalbert/silext to your composer.json and register the required service providers
Features
Modularity
To enable the modules feature you only need to register the Vonalbert\Silext\Provider\ModularityServiceProvider service provider
and use the modules service to register the modules objects
$app->register(new \Vonalbert\Silext\Provider\ModulesServiceProvider); $app['modules']->add(new ModuleA); $app['modules']->addModules([ new ModuleB('/route-prefix-b'), new ModuleB('/route-prefix-c'), // ... ]);
A class to recognized as module must extend the Vonalbert\Silext\Module abstract class that require the
implementation of the abstract methods setRoutes and bootstrap
abstract protected function setRoutes(ControllerCollection $router); abstract protected function bootstrap(Application $app);
setRoutes is called at registration time and accept a Silex\ControllerCollection that allows routes registration.
bootstrap is called at the module bootstrapping.
A module is bootstrapped only if one of its routes is matching the current request.