CakePHP is widely known for its technology prominence that it always sticks to, with leveraging updates and advanced releases.
The versions for CakePHP that we used in the year 2014 kept changing fast with amazing new updates to help developers attain an easy and smooth approach in CakePHP programming. This helped them building ever advanced and authentic applications across with the versions consistently getting updated more than twice in a month.
The latest update that CakePHP has come up with at the onset of 2015 is dubbed as CakePHP 3.0.0-RC1 Release. As mentioned in the official site, it is more about polishing the rough edges that are being worked on continuously with the help of the community.
The whole effort includes API changes, particularly from the validation subsystem covering various issues from the previous updates.
Here’s the detailed list:
With the update done on the 2nd of Jan, you can see the validation process parted into two stages. The first stage (that is a user-facing type of validation) is kept all the same that it used to be earlier just that the location and time of its performance is changed.
What you used to have earlier looks like this:
And now, it is performed when the entity is created and not when you save them. For this, you have to validate with either newEntity or patchEntity methods. This is what you do here:
So, now if you look closely into the results you will find that the fields that do not pass the validation will not be shown in the resulting entity.
Second part of it is “application rules”. This validation step is operated while you save or delete an entity. It will help you to do a more authentic check on application integrity taking into account factors like matching columns, arity or foreignKey constraints. Have a look on how it works:
Further, with the update, you are now able to apply business logic checks for entities like state machines and workflow states. Also the methods like validate() and validateMany() no longer exist in the Table class.
New Error Pages
To provide an easy read for exception stack traces, error pages have been redesigned allowing the user to spot and track the errors easily and effectively. It seems to be inspired by Rails’ better errors plugin.
New Bake Plugin
Cake Bake command now transforms into plugin with this update. This allows to pace up the codes to the next level to bring in new code generators and configuration options. Among other important changes, it includes referring to CakePHP’s View system to render the templates. With this update, outputs can be modified using events like Bake.beforeRender and Bake.afterRender.
Apply this code to get the plugin running:
This had been pending for long. Yes, it is now possible to define an object and validate form data without having to work with object relational mapping tables.
The coding style for PSR 2 has been changed to be followed at different standards. This applies to all the official plugins.
ORM Related Improvements
This is the latest you have for 3.0, done and implemented with the support of the CakePHP community – inclusively based on the contribution for ideas, codes, documentation and standards, leaving the outdated behind!