Download the PHP package brokencube/circuit without Composer
On this page you can find all versions of the php package brokencube/circuit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brokencube/circuit
More information about brokencube/circuit
Files in brokencube/circuit
Package circuit
Short Description Microframework - controller+dispatcher
License MIT
Informations about the package circuit
circuit
Router + Middleware built on top of HTTP Foundation and FastRoute
Basic Usage
See FastRoute docs for more info on advanced matching patterns, grouping etc
Generally:
$controllerName
should be in format namespaced\ControllerClass@method
(Similar to Laravel)
Controllers
Controllers must implement the Circuit\Interfaces\Controller
interface
Note: Currently Circuit only supports the "Service Locator" pattern for DI. In future versions, autowiring will be introduced and the interface requirement above will be relaxed.
Middleware
middleware/AddCookie.php
routes.php
Add middleware individually to a route
Or register the middleware in the router, and call it by name
Or add middleware to a group of routes
Or add middleware to be run before a route is even matched (this will logically be applied to all routes, as it happens before the matching step. This allows for middleware to modify the route before matching)
Middleware will be run in the order defined, with preroute middleware always running first, e.g.:
All versions of circuit with dependencies
psr/cache Version ^1.0
psr/log Version ^1.0
psr/simple-cache Version ^1.0
psr/container Version ^1.0
nikic/fast-route Version ^1.2
symfony/http-foundation Version ^3.2