What Is New in CakePHP 3.3
CakePHP 3.3 introduces a set of focused enhancements and new tools for building applications more efficiently. The update brings a new plugin for generating CRUD interfaces, significant improvements to the ORM and console tools, and several deprecated features in preparation for future versions.
| Category | Key Changes |
|---|---|
| New Features | Bake plugin for CRUD, New console output styles, Middleware Dispatcher, PSR-7 support. |
| Improvements | ORM query performance, Association handling, Console output formatting, i18n utilities. |
| Deprecated | Controller action blacklist, Network/CakeRequest & Network/CakeResponse, Several helper methods. |
| Bug Fixes | Various fixes across ORM, View, Console, and Routing components. |
How does the new CRUD plugin improve development?
The new CRUD plugin, extracted from the CakeDC's plugin, is now a core tool. It provides a standardized way to build JSON APIs and scaffolded interfaces quickly. In practice, this means less boilerplate code for standard create, read, update, and delete operations.
You enable it by loading the plugin in your src/Application.php. It integrates with the existing
AuthComponent and offers event-driven customization points, making it flexible for complex business logic.
What ORM improvements should I know about?
Association handling got smarter. You can now use contain() to filter associated data directly,
which is more intuitive than writing separate queries. The save() and delete() methods
also saw under-the-hood optimizations for better performance with complex data graphs.
Query Performance
Lazy loading of associations is more efficient, reducing memory overhead. The translation behavior
(I18n) now works seamlessly with the find('list') method, which is a common pain point
solved.
Why were changes made to the Console system?
The console output system was refactored to be more extensible and visually consistent. New styling options for success, error, and info messages make CLI tools more user-friendly. This matters because developers spend a lot of time in the terminal, and clear feedback is crucial.
The ConsoleOutput class now uses a styles set, allowing you to create custom output formats. The
abort() method was added to Shell for clean error handling and exiting.
What is deprecated and needs my attention?
Several components are deprecated to pave the way for a more modern HTTP layer. The
Network\CakeRequest and Network\CakeResponse classes are the most notable, replaced by
PSR-7 interfaces and the new Http library.
Controller & Helper Methods
The blacklist property in SecurityComponent is deprecated in favor of unlockedFields.
Methods like HtmlHelper::meta() and NumberHelper::format() with specific signatures
are also on the list. Start updating these now to avoid breaks in 3.4.
FAQ
Is the new CRUD plugin included by default?
No, it's an optional plugin. You must install it
via Composer and load it in your application's bootstrap process to use its features.
How do I replace the deprecated CakeRequest and CakeResponse?
Start using the new
Http\ServerRequest and Http\Response classes. The migration guide provides examples
for converting your existing code.
Are there any breaking changes in 3.3?
No intentional breaks, but deprecations are warnings
for the future. Test your application with deprecation warnings enabled to see what needs updating.
What's the benefit of the Middleware Dispatcher?
It allows a more modular, stack-based
approach to HTTP request handling. This is a step towards CakePHP 4 and makes it easier to use cross-cutting
concerns like CORS or authentication.
Did the file structure or naming conventions change?
No, the fundamental conventions remain
the same. The changes are primarily additive or internal improvements, not structural overhauls.