Getting started
Routing and controllers
Command line
Databases (SQL)
Databases (NoSQL)
Security
Packages
Learn more
- Array helper
- Caching
- Command bus
- Date and time
- Events
- File system
- HTML helper
- Humanizer
- Image manipulation
- Internationalization
- Logging
- Number helper
- Pagination
- Sessions
- String helper
- URL builder
- UUID helper
- Validation
- Views
Official packages
Upgrading
This guide takes you through the steps needed to migrate from Mako 5.2.x
to 5.3.x
.
Application
You'll have to create a constraints.php
file and a constraints
directory in your app/routing
directory (remember to add a .gitkeep
file in the constraints
directory).
Framework
Routing
The when
method has been renamed to patterns
.
HTTP Middleware
All HTTP middleware must now implement the mako\http\routing\middleware\MiddlewareInterface
. An abstract class (mako\http\routing\middleware\Middleware
) implementing parts of the interface is included.
Middleware parameters are no longer injected through the constructor but instead via a the setParameters
method (implemented by the abstract base class). Classes extending the included abstract base middleware can also retrieve parameters using the getParameter
method.
Middleware is now registered with the route dispatcher.
// Old
$middleware->register('foo', Foo::class);
// New
$dispatcher->registerMiddleware('foo', Foo::class);
Middleware priority is now registered with the route dispatcher.
// Old
$middleware->setPriority(['foo' => 1]);
// New
$dispatcher->setMiddlewarePriority(['foo' => 1]);
See the routing docs for more details.