{"id":510,"date":"2015-01-09T09:27:34","date_gmt":"2015-01-09T09:27:34","guid":{"rendered":"http:\/\/www.cakephpexpert.com\/blog\/?p=510"},"modified":"2015-01-12T08:54:41","modified_gmt":"2015-01-12T08:54:41","slug":"the-roadmap-of-cakephp-past-releases-2014","status":"publish","type":"post","link":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014","title":{"rendered":"The Roadmap of CakePHP Past Releases 2014"},"content":{"rendered":"<p>CakePHP is widely known for its technology prominence that it always sticks to, with leveraging updates and advanced releases. <!--more--><\/p>\n<p>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 <a href=\"http:\/\/www.cakephpexpert.com\/services\" target=\"_blank\"><strong>CakePHP programming<\/strong><\/a>. This helped them building ever advanced and authentic applications across with the versions consistently getting updated more than twice in a month.<br \/>\nThe 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.<br \/>\n<a href=\"http:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-540\" src=\"http:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg\" alt=\"Cakephp Development\" width=\"740\" height=\"350\" srcset=\"https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg 740w, https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350-300x141.jpg 300w\" sizes=\"(max-width: 740px) 100vw, 740px\" \/><\/a><\/p>\n<p>The whole effort includes API changes, particularly from the validation subsystem covering various issues from the previous updates.<br \/>\n<strong>Here\u2019s the detailed list:<\/strong><\/p>\n<p><strong>Revamped Validation<\/strong><br \/>\nWith 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.<br \/>\n<strong>What you used to have earlier looks like this:<\/strong><\/p>\n<div style=\"background-color: #e0ecf8; float: left; width: 90%; padding: 10px 5%; margin-bottom: 20px; border: 1px solid;\"><code>$article = $this-&gt;Articles-&gt;newEntity ($this-&gt;request-&gt;data);<br \/>\n$this-&gt;Articles-&gt;save ($article, ['validate' =&gt; 'myCustomValidatorName']);<br \/>\n<\/code><\/div>\n<p>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. <strong>This is what you do here:<\/strong><\/p>\n<div style=\"background-color: #e0ecf8; float: left; width: 90%; padding: 10px 5%; margin-bottom: 20px; border: 1px solid;\"><code><code>$article = $this-&gt;Articles-&gt;newEntity ($this-&gt;request-&gt;data, [<\/code><\/code>&#8216;validate&#8217; =&gt; &#8216;myCustomValidatorName&#8217;<\/p>\n<p>]);<\/p>\n<p>$this-&gt;Articles-&gt;save ($article);<\/p>\n<\/div>\n<p>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.<\/p>\n<p>Second part of it is &#8220;application rules&#8221;. 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:<\/p>\n<div style=\"background-color: #e0ecf8; float: left; width: 90%; padding: 10px 5%; margin-bottom: 20px; border: 1px solid;\">\n<p>\/\/ In UsersTable.php<\/p>\n<p>public function buildRules(RulesChecker $rules) {<\/p>\n<p>$rules-&gt;add ($rules-&gt;isUnique (&#8217;email&#8217;));<\/p>\n<p>return $rules;<\/p>\n<p>}<\/p>\n<\/div>\n<p>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.<\/p>\n<p><strong>New Error Pages<\/strong><br \/>\nTo 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&#8217; better errors plugin.<\/p>\n<p><strong>New Bake Plugin<\/strong><\/p>\n<p>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&#8217;s View system to render the templates. With this update, outputs can be modified using events like Bake.beforeRender and Bake.afterRender.<\/p>\n<p><strong>Apply this code to get the plugin running:<\/strong><\/p>\n<div style=\"background-color: #e0ecf8; float: left; width: 90%; padding: 10px 5%; margin-bottom: 20px; border: 1px solid;\"><code>composer require cakephp\/bake=dev-master \u2013dev<br \/>\n<\/code><\/div>\n<p><strong>Table-less Forms<\/strong><br \/>\nThis 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.<br \/>\n<strong>Here\u2019s how:<\/strong><\/p>\n<div style=\"background-color: #e0ecf8; float: left; width: 90%; padding: 10px 5%; margin-bottom: 20px; border: 1px solid;\"><code>public function add()<br \/>\n{<br \/>\n$contact = new ContactForm();<br \/>\nif ($this-&gt;request-&gt;is('post')) {<br \/>\nif ($contact-&gt;execute($this-&gt;request-&gt;data)) {<br \/>\n$this-&gt;Flash-&gt;success ('We will get back to you soon.');<br \/>\nreturn $this-&gt;redirect(['action' =&gt; 'add']);<br \/>\n}<br \/>\n$this-&gt;Flash-&gt;error ('There was a problem submitting your form.');<br \/>\n}<br \/>\n$this-&gt;set ('contact', $contact);<br \/>\n}<\/code><\/div>\n<p><strong>Adopted PSR-2<\/strong><\/p>\n<p>The coding style for PSR 2 has been changed to be followed at different standards. This applies to all the official plugins.<\/p>\n<p><strong>ORM Related Improvements<\/strong><\/p>\n<div style=\"background-color: #e0ecf8; float: left; width: 90%; padding: 10px 5%; margin-bottom: 20px; border: 1px solid;\"><code>Introduced Query::firstOrFail ()<br \/>\nJoinType can be changed in TranslateBehavior<br \/>\nSimultaneously adding multiple associations in now possible with Table::addAssociations ()<br \/>\nIS NOT operator support is available<br \/>\nmatching () and contain() can be now called for similar association alias<\/code><\/div>\n<p>This is the latest you have for 3.0, done and implemented with the support of the CakePHP community \u2013 inclusively based on the contribution for ideas, codes, documentation and standards, leaving the outdated behind!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CakePHP is widely known for its technology prominence that it always sticks to, with leveraging updates and advanced releases.<\/p>\n","protected":false},"author":1,"featured_media":540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27,12],"tags":[35,15,62,61,36],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The Roadmap of CakePHP Past Releases 2014 - Cakephp Expert Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Roadmap of CakePHP Past Releases 2014 - Cakephp Expert Blog\" \/>\n<meta property=\"og:description\" content=\"CakePHP is widely known for its technology prominence that it always sticks to, with leveraging updates and advanced releases.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014\" \/>\n<meta property=\"og:site_name\" content=\"Cakephp Expert Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-09T09:27:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-01-12T08:54:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"740\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/#website\",\"url\":\"https:\/\/www.cakephpexpert.com\/blog\/\",\"name\":\"Cakephp Expert Blog\",\"description\":\"Cakephp Development Company\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.cakephpexpert.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg\",\"contentUrl\":\"https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg\",\"width\":740,\"height\":350,\"caption\":\"Cakephp Development Services\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#webpage\",\"url\":\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014\",\"name\":\"The Roadmap of CakePHP Past Releases 2014 - Cakephp Expert Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#primaryimage\"},\"datePublished\":\"2015-01-09T09:27:34+00:00\",\"dateModified\":\"2015-01-12T08:54:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/#\/schema\/person\/0f12b00f339dcf099f8431b3ba0db2e1\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.cakephpexpert.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Roadmap of CakePHP Past Releases 2014\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/#\/schema\/person\/0f12b00f339dcf099f8431b3ba0db2e1\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.cakephpexpert.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/28e9fe1b5e695a0ed4f8d10cb1186b26?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/28e9fe1b5e695a0ed4f8d10cb1186b26?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/www.cakephpexpert.com\/\"],\"url\":\"https:\/\/www.cakephpexpert.com\/blog\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Roadmap of CakePHP Past Releases 2014 - Cakephp Expert Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014","og_locale":"en_US","og_type":"article","og_title":"The Roadmap of CakePHP Past Releases 2014 - Cakephp Expert Blog","og_description":"CakePHP is widely known for its technology prominence that it always sticks to, with leveraging updates and advanced releases.","og_url":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014","og_site_name":"Cakephp Expert Blog","article_published_time":"2015-01-09T09:27:34+00:00","article_modified_time":"2015-01-12T08:54:41+00:00","og_image":[{"width":740,"height":350,"url":"https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg","path":"\/home\/octal411\/public_html\/cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg","size":"full","id":540,"alt":"Cakephp Development Services","pixels":259000,"type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.cakephpexpert.com\/blog\/#website","url":"https:\/\/www.cakephpexpert.com\/blog\/","name":"Cakephp Expert Blog","description":"Cakephp Development Company","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cakephpexpert.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#primaryimage","inLanguage":"en-US","url":"https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg","contentUrl":"https:\/\/www.cakephpexpert.com\/blog\/wp-content\/uploads\/2015\/01\/cakephp3.0-740x350.jpg","width":740,"height":350,"caption":"Cakephp Development Services"},{"@type":"WebPage","@id":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#webpage","url":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014","name":"The Roadmap of CakePHP Past Releases 2014 - Cakephp Expert Blog","isPartOf":{"@id":"https:\/\/www.cakephpexpert.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#primaryimage"},"datePublished":"2015-01-09T09:27:34+00:00","dateModified":"2015-01-12T08:54:41+00:00","author":{"@id":"https:\/\/www.cakephpexpert.com\/blog\/#\/schema\/person\/0f12b00f339dcf099f8431b3ba0db2e1"},"breadcrumb":{"@id":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.cakephpexpert.com\/blog\/the-roadmap-of-cakephp-past-releases-2014#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cakephpexpert.com\/blog"},{"@type":"ListItem","position":2,"name":"The Roadmap of CakePHP Past Releases 2014"}]},{"@type":"Person","@id":"https:\/\/www.cakephpexpert.com\/blog\/#\/schema\/person\/0f12b00f339dcf099f8431b3ba0db2e1","name":"admin","image":{"@type":"ImageObject","@id":"https:\/\/www.cakephpexpert.com\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/28e9fe1b5e695a0ed4f8d10cb1186b26?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/28e9fe1b5e695a0ed4f8d10cb1186b26?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/www.cakephpexpert.com\/"],"url":"https:\/\/www.cakephpexpert.com\/blog\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/posts\/510"}],"collection":[{"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/comments?post=510"}],"version-history":[{"count":30,"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/posts\/510\/revisions"}],"predecessor-version":[{"id":520,"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/posts\/510\/revisions\/520"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/media\/540"}],"wp:attachment":[{"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/media?parent=510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/categories?post=510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cakephpexpert.com\/blog\/wp-json\/wp\/v2\/tags?post=510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}