guide42 / choclo
This package is abandoned and no longer maintained.
No replacement package was suggested.
Configuration Framework
dev-master
2015-12-10 00:39 UTC
Requires
- php: >=5.5
Requires (Dev)
- satooshi/php-coveralls: @stable
This package is auto-updated.
Last update: 2022-02-01 12:40:46 UTC
README
(by Artful Magpie)
Choclo is a two-step configuration framework.
This is a PoC. DO NOT USE IT IN PRODUCTION.
Usage
use Guide42\Choclo\Configurator; class MyApp extends Configurator { const PHASE_ROUTES = 60; public function addRoute($name, $pattern, \Closure $controller) { $connect = function() use ($name, $pattern, $controller) { $route = new Route($pattern, array( '_controller' => $controller, )); $routes = $this->getRegistry()->get('Symfony\Component\Routing\RouteCollection'); $routes->add($name, $route); }; $this->register('route-' . $name, $connect, self::PHASE_ROUTES); } }