This version is outdated. You should upgrade your project to Mako 9.1 or Mako 10.0!
Getting started

Upgrading



This guide takes you through the steps needed to migrate from Mako 5.0.x to 5.1.x.


Application

Configuration

Add the new base_url config key to your application configuration file.


Framework

JSONP responses

Use the JSON response builder for both JSON and JSONP.

Middleware

There is a new syntax for passing arguments to route middleware rules.

ORM foreign-keys

The ORM now uses Str::camel2underscored() instead of strtolower() when generating the foreign key names. Most applications should be unaffected but you can configure the foreign key name using the $foreignKeyName property so that you don't have to do any changes to your database.

Query builder

The query builder convenience trait has been removed. Use the where methods instead.

Validation

There is a new syntax for passing arguments to validation rules.

Piped validation rules (deprecated since Mako 3.6) are no longer supported, use an array instead.

Views

Views are no longer auto rendered by the response class. They should be rendered in the controller.