<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1303777562440464932</id><updated>2026-07-17T22:18:07.069-07:00</updated><category term="Cakephp"/><category term="Cakephp2.0"/><category term="Mobile.Cakephp"/><category term="PHP"/><category term="plugin"/><title type='text'>Chetan&#39;s CakePHP</title><subtitle type='html'>I Born To Work On CakePHP.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-6844131436940165884</id><published>2012-09-15T04:39:00.002-07:00</published><updated>2012-10-17T23:11:24.372-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp"/><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp2.0"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>Remember before making cakephp application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Hello
Cakebakers,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;background-color: white; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Aim of this post is enhance the quallity,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;maintainability of cakephp application.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;1. Fat
 Models and Skinny Controllers&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;2. Create
 the maximum common function&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-weight: normal; margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #0066cc; font-size: large;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;-
Should make helper if you want to make common function in view side&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #0066cc; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;-
Should make component or common function in app_controller if you
want to make common function in Controller side&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: normal; margin-bottom: 0.2in;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;3. Reducing
 Use of&lt;/b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; App::import(&#39;Controller&#39;,&#39;yourControllerName&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $variable_name = new yourControllerName(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #3d85c6;&quot;&gt; Because:&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt; &amp;nbsp; It loads a whole controller class. &lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #0084d1; font-size: large;&quot;&gt;&lt;b&gt;Solution :&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;Make a common function in AppController.php &lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;4. Reducing
 use of Model in View side&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Like :&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&amp;nbsp;App::import(&#39;Model&#39;,&#39;yourModelName&#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $variable_name = new yourModelName();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;$variablename-&amp;gt;find(&#39;all&#39;);&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Because :&lt;span style=&quot;background-color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/b&gt;It violate MVC rules&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;More details :&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt; http://chetan4cake.blogspot.in/2012/04/find-in-view-in-cakephp.html &lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;5. Reducing use of requestaction() &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Because :&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;It slows down perfomance of webpage.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Solution :&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Use Concept of Fat Models and Skinny Controllers&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Example :&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Make a function in your Category model&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;function getCategories(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $categories = $this-&amp;gt;find(&#39;all&#39;,array(&#39;recursive&#39; =&amp;gt; &#39;-1&#39;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $categories;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In our controller we can call this function and pass it to element.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;$categories = $this-&amp;gt;Category-&amp;gt;getCategories();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;set(&#39;categories&#39;,$categories);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;&amp;nbsp; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;6. CakePHP Components :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Components are relatively heavy - they use big memory to your application. They definitely have their place, but take care to include only the ones you really need, since they are loaded on every request.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Reducing use of var $components = array(&#39;...&#39;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;Solution :&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use App::import(&#39;Componant&#39;,&#39;...&#39;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;But sometime we have to use var $componants; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;7. Load Cakephp Vendor files lazily&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cake
has great support for vendor code - that is, 3rd party libraries that
you call from your application to avoid re-implementing the wheel. Be
wary, however, of calling App::import(’Vendor’, …); at the top
of any of your controllers or components. What this does is load the
vendor libraries for every page on your site, even if that code is
not used! Instead, place your App::import() statement immediately
before you use the library. That way, it is only loaded if you
actually make the call!&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #0066cc; font-size: large;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;8. Reducing Use of $uses Unless You Really, Absolutely Have To.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use concept of &lt;span style=&quot;color: #3d85c6;&quot;&gt;Model Chains&lt;/span&gt;.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $uses is a controller attribute that allows you to access additional models to the default one. Say you have a blog application and one of the controllers is posts. By default you have access to the Post model. If you wanted to also have access to the Comment model you could do (but shouldn&#39;t):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;class PostsController extends AppController {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var $name = &#39;Posts&#39;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var $uses = array(&#39;Post&#39;, &#39;Comment&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Model Chains&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since Comment is associated to Post through a HasMany relationship you can access the Comment model through Post. Like this:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $comments = $this-&amp;gt;Post-&amp;gt;Comment-&amp;gt;findAllByPostId($id);&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;The relation chain extends infinitely, including all models down the line. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;9. Url
   rewriting should be done from routes.php instead of writing or
   changing in .htaccess&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #0066cc; font-size: large;&quot;&gt;&lt;b&gt; &lt;span style=&quot;color: #0b5394;&quot;&gt;10
. Library extensions should be added in app/Lib folder instead of
addding it in cakePHP&#39;s base library&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt; 11.
Maintain bootstrap.php file&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: #0066cc; font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        
&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt; - Define
all constant variable ,site URL , third-party credential,plugin url
in bootstrap.php file&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;b&gt;Suggest me if I am somewhere wrong.Any suggestion are welcome.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.2in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/6844131436940165884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/09/remember-before-making-cakephp.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/6844131436940165884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/6844131436940165884'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/09/remember-before-making-cakephp.html' title='Remember before making cakephp application'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-3478524856956176017</id><published>2012-08-09T05:29:00.001-07:00</published><updated>2012-08-30T23:55:00.339-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp"/><title type='text'>CakePHP JOIN</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hello CakeBakers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD-DRgjoye-FlzYnLvPzYkMsHnSDDrD0W-98Fc8Vybx_EgW0cozu73aKd5MAKAC-XqzcG-1RBn_iKiCsbD43dfoKGwTqrruayBRfm5N9BE-hKt7VsdFCWKrZzEmN_s5oN1BN6-AwyNBc0/s1600/Untitled-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cakephp Join&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD-DRgjoye-FlzYnLvPzYkMsHnSDDrD0W-98Fc8Vybx_EgW0cozu73aKd5MAKAC-XqzcG-1RBn_iKiCsbD43dfoKGwTqrruayBRfm5N9BE-hKt7VsdFCWKrZzEmN_s5oN1BN6-AwyNBc0/s1600/Untitled-1.jpg&quot; title=&quot;Cakephp Join&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/3478524856956176017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/08/cakephp-join.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3478524856956176017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3478524856956176017'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/08/cakephp-join.html' title='CakePHP JOIN'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD-DRgjoye-FlzYnLvPzYkMsHnSDDrD0W-98Fc8Vybx_EgW0cozu73aKd5MAKAC-XqzcG-1RBn_iKiCsbD43dfoKGwTqrruayBRfm5N9BE-hKt7VsdFCWKrZzEmN_s5oN1BN6-AwyNBc0/s72-c/Untitled-1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-6884705939600656467</id><published>2012-07-12T09:28:00.002-07:00</published><updated>2012-08-30T23:56:34.659-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp"/><title type='text'>MVC of CakePHP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Hello CakeBakers, I attach the best image of mvc stucture of cakephp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzb_DI1NWcI02FNbFvqwNd1kFNLQEhvQ721gMN2_UY2aHfIYcN0JDyJuPZwZnv0zzleN8Tf4ukTrQRLo1jw1tr4wA6x9ay6RYeTmbIaXnHImRh_RVTK72NedvlVAzwAmX_f1RKP5jf9f8/s1600/cakePHP-MVC.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;446&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzb_DI1NWcI02FNbFvqwNd1kFNLQEhvQ721gMN2_UY2aHfIYcN0JDyJuPZwZnv0zzleN8Tf4ukTrQRLo1jw1tr4wA6x9ay6RYeTmbIaXnHImRh_RVTK72NedvlVAzwAmX_f1RKP5jf9f8/s640/cakePHP-MVC.jpg&quot; width=&quot;640&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/6884705939600656467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/07/mvc-of-cakephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/6884705939600656467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/6884705939600656467'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/07/mvc-of-cakephp.html' title='MVC of CakePHP'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzb_DI1NWcI02FNbFvqwNd1kFNLQEhvQ721gMN2_UY2aHfIYcN0JDyJuPZwZnv0zzleN8Tf4ukTrQRLo1jw1tr4wA6x9ay6RYeTmbIaXnHImRh_RVTK72NedvlVAzwAmX_f1RKP5jf9f8/s72-c/cakePHP-MVC.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-5317075307992522821</id><published>2012-07-11T06:03:00.001-07:00</published><updated>2012-08-30T23:57:28.920-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp"/><title type='text'>Email in CakePHP 2.0+</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;CakeEmail is a new class to send email. With this class you can send email from any place of your application. In addition to using the EmailComponent from your controller, you can also send mail from Shells, and Models.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;This class replaces the EmailComponent and gives more flexibility in sending emails. For example, you can create your own transports to send email instead of using the provided smtp and mail.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Most sites need a way to send out emails. CakePHP provides a simple way to send both html and plain text emails using the email component. Here’s how I deployed and used the email component.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;At the appropriate point (after the add is complete) I call a custom function:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;$this-&amp;gt;__sendEmailConfirm($this-&amp;gt;User-&amp;gt;id,$activationKey ) &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;The sendEmailConfirm function looks like this:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;function __sendEmailConfirm($user_id,$activatiinHash)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; App::uses(&#39;CakeEmail&#39;, &#39;Network/Email&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $user = $this-&amp;gt;User-&amp;gt;find(&#39;first&#39;,array(&#39;conditions&#39;=&amp;gt;array(&#39;User.id&#39; =&amp;gt; $user_id),&#39;fields&#39;=&amp;gt;array(&#39;User.id&#39;,&#39;User.email&#39;,&#39;User.name&#39;),&#39;recursive&#39;=&amp;gt;0));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ($user === false)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; debug(__METHOD__.&quot; failed to retrieve User data for user.id: {$user_id}&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $activate_url = &#39;http://&#39; . env(&#39;SERVER_NAME&#39;) . &#39;/users/activate/&#39; . $user[&#39;User&#39;][&#39;id&#39;] . &#39;/&#39; . $activatiinHash;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $name = $user[&#39;User&#39;][&#39;name&#39;];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $email = new CakeEmail();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $email-&amp;gt;from(array(&#39;noreply@&#39;.env(&#39;SERVER_NAME&#39;) =&amp;gt;&amp;nbsp; &#39;MY Site&#39;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $email-&amp;gt;to($user[&#39;User&#39;][&#39;email&#39;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $email-&amp;gt;subject(env(&#39;SERVER_NAME&#39;) . &#39; Please confirm your email address&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $email-&amp;gt;template(&#39;user_confirm&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $email-&amp;gt;emailFormat(&#39;html&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $email-&amp;gt;viewVars(array(&#39;activate_url&#39; =&amp;gt; $activate_url,&#39;name&#39; =&amp;gt; $name));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return $email-&amp;gt;send();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;I then have a folder called ‘Emails’ in my View folder.This contains two sub folders, ‘html’ and ‘text’. Within the html folder I have a template called ‘user_confirm.ctp’.&lt;br /&gt;This relates to the template I am calling in my __sendEmailConfirm function. &lt;br /&gt;$email-&amp;gt;emailFormat(&#39;html&#39;); specifies I am sending an HTML email,&lt;br /&gt;, so Cake looks in the View/Emails/html folder for a template that matches the value set by $email-&amp;gt;template(&#39;xxx&#39;); – in my case xxx = ‘user_confirm’.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;So the output of the email are determined by these two lines:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;$email-&amp;gt;template(&#39;user_confirm&#39;);&lt;br /&gt;$email-&amp;gt;emailFormat(&#39;html&#39;); &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;The user_confirm.ctp file can be as complex or simple as you choose. In my case I have this:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Hey there &amp;lt; ? = $name ? &amp;gt;, we will have you up and running in no time, but first we just need you to confirm your user account by clicking the link below:&lt;br /&gt;&lt;br /&gt;&amp;lt; ? = $activate_url ? &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Within each of the subfolders, create a default.ctp file, which is the layout that will receive and wrap the email element.&lt;br /&gt;&lt;br /&gt;My default.ctp file in the View/Layouts/Emails/html folder is very simple:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt; ! DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt; ? php echo $content_for_layout; ? &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/5317075307992522821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/07/email-in-cakephp-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/5317075307992522821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/5317075307992522821'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/07/email-in-cakephp-20.html' title='Email in CakePHP 2.0+'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-4643624411667543799</id><published>2012-06-26T22:53:00.001-07:00</published><updated>2012-08-30T23:59:13.687-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp"/><title type='text'>Exception handling in cakephp 2.0+</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Now, I discribe step by step how to handle error 400,403,404,405,501 in cakephp2.0+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Step-1 :&lt;/b&gt; &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Update /app/Config/core.php&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;open&amp;nbsp; /app/Config/core.php, and find the following:&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Configure::write(&#39;Exception&#39;, array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;handler&#39; =&amp;gt; &#39;ErrorHandler::handleException&#39;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;renderer&#39; =&amp;gt; &#39;ExceptionRenderer&#39;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;log&#39; =&amp;gt; true&lt;br /&gt;));&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;and Replace with following:&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Configure::write(&#39;Exception&#39;, array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;handler&#39; =&amp;gt; &#39;ErrorHandler::handleException&#39;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;renderer&#39; =&amp;gt; &#39;AppExceptionRenderer&#39;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;log&#39; =&amp;gt; true&lt;br /&gt;));&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Step-2 :&lt;/b&gt; Create following file if not exists&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;1. /app/View/Errors/error400.ctp&lt;br /&gt;2. /app/View/Errors/error403.ctp&lt;br /&gt;3. /app/View/Errors/error404.ctp&lt;br /&gt;4. /app/View/Errors/error405.ctp&lt;br /&gt;5. /app/View/Errors/error500.ctp&lt;br /&gt;6. /app/View/Errors/error501.ctp&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;in above file , you can put your custom error design.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Step-3 :&lt;/b&gt; Create /app/Lib/Error/AppExceptionRenderer.php&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;App::uses(&#39;ExceptionRenderer&#39;, &#39;Error&#39;);&lt;br /&gt;&lt;br /&gt;class AppExceptionRenderer extends ExceptionRenderer {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*-------------------------------------------------------------------------*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* -- Exceptions&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*-------------------------------------------------------------------------*/&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function notFound($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;beforeFilter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;set(&#39;title_for_layout&#39;, &#39;Not Found&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;render(&#39;/Errors/error404&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;response-&amp;gt;send();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function badRequest($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;beforeFilter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;set(&#39;title_for_layout&#39;, &#39;Not Found&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;render(&#39;/Errors/error400&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;response-&amp;gt;send();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function forbidden($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;beforeFilter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;set(&#39;title_for_layout&#39;, &#39;Not Found&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;render(&#39;/Errors/error403&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;response-&amp;gt;send();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function methodNotAllowed($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;beforeFilter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;set(&#39;title_for_layout&#39;, &#39;Not Found&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;render(&#39;/Errors/error405&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;response-&amp;gt;send();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function internalError($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;beforeFilter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;set(&#39;title_for_layout&#39;, &#39;Not Found&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;render(&#39;/Errors/error500&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;response-&amp;gt;send();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function notImplemented($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;beforeFilter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;set(&#39;title_for_layout&#39;, &#39;Not Found&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;render(&#39;/Errors/error501&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;controller-&amp;gt;response-&amp;gt;send();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*-------------------------------------------------------------------------*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* -- Other&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*-------------------------------------------------------------------------*/&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingController($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;notFound($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingAction($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;notFound($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingView($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;notFound($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingLayout($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingHelper($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingBehavior($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingComponent($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingTask($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingShell($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingShellMethod($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingDatabase($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingConnection($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function missingTable($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function privateAction($error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;internalError($error);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;-- in above function,&lt;br /&gt;&amp;nbsp;&amp;nbsp; set method:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; We need to do is set our title_for_layout variable so it’s passed to the view&lt;br /&gt;&amp;nbsp;&amp;nbsp; render method :&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The first params is the view you want to render and &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The second params is the layout to render it in (second is optional).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/4643624411667543799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/06/exception-handling-in-cakephp-20.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/4643624411667543799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/4643624411667543799'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/06/exception-handling-in-cakephp-20.html' title='Exception handling in cakephp 2.0+'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-8868668079958815141</id><published>2012-06-05T21:39:00.000-07:00</published><updated>2012-08-31T00:00:17.330-07:00</updated><title type='text'>Authentication for browser back button</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #e69138; font-size: x-large;&quot;&gt;How to authentication for browser back button in cakephp 2.x ?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: large;&quot;&gt;problem :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Once you are logging out of the application &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; you are still able to see the previous pages using browser back button.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; then for resolving it, add below code.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-size: large;&quot;&gt;Solution :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Add below code in your AppController.php&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;public function beforeRender() {&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;response-&amp;gt;disableCache();&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/8868668079958815141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/06/authentication-for-browser-back-button.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/8868668079958815141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/8868668079958815141'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/06/authentication-for-browser-back-button.html' title='Authentication for browser back button'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-6322214368007537666</id><published>2012-06-01T10:25:00.002-07:00</published><updated>2012-06-03T10:08:39.223-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><title type='text'>Simple DEMO of Search plugin in Cakephp 2.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #e69138; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: x-large; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #e69138; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: x-large; font-weight: normal;&quot;&gt;How to configure Search plugin in Cakephp 2.x&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&amp;nbsp;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;


&lt;span style=&quot;font-size: large;&quot;&gt;












1. Download Search plugin from :&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;


&lt;span style=&quot;font-size: large;&quot;&gt;












&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;https://github.com/CakeDC/search&quot; style=&quot;font-weight: normal;&quot;&gt;https://github.com/CakeDC/search&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;


&lt;span style=&quot;font-size: large;&quot;&gt;












2. Put it in app/Plugin.&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;3. Create Database :&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;&amp;nbsp;












&lt;span style=&quot;font-size: large;&quot;&gt;Database name : search&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;










&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;




&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;CREATE TABLE IF NOT EXISTS `tickets` (&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; `id` int(11) NOT NULL AUTO_INCREMENT,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; `status` varchar(25) NOT NULL,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; `category` varchar(50) NOT NULL,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; `title` varchar(50) NOT NULL,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; `content` varchar(250) NOT NULL,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; `created` datetime NOT NULL,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; `modified` datetime NOT NULL,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp; PRIMARY KEY (`id`)&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;) ENGINE=InnoDB&amp;nbsp; DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;4. Database Configuration :&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;public $default = array(&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;datasource&#39; =&amp;gt; &#39;Database/Mysql&#39;,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;persistent&#39; =&amp;gt; false,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;host&#39; =&amp;gt; &#39;yourhost&#39;,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;login&#39; =&amp;gt; &#39;yourusername&#39;,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;password&#39; =&amp;gt; &#39;yourpassword&#39;,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;database&#39; =&amp;gt; &#39;search&#39;,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;prefix&#39; =&amp;gt; &#39;&#39;,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //&#39;encoding&#39; =&amp;gt; &#39;utf8&#39;,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;









&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;5. Add below code in app/bootstrap.php&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;









&amp;nbsp;&amp;nbsp;





&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&lt;br /&gt;CakePlugin::loadAll(array(&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;Search&#39; =&amp;gt; array(&#39;routes&#39; =&amp;gt; true, &#39;bootstrap&#39; =&amp;gt; true),&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;









&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;







&lt;span style=&quot;font-size: large;&quot;&gt;6. Make TicketsController.php&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;














&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;lt; ? php &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;App::uses(&#39;AppController&#39;, &#39;Controller&#39;);&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* Tickets Controller&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @property Ticket $Ticket&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;class TicketsController extends AppController {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;public $components = array(&#39;Search.Prg&#39;);&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public $presetVars = array(&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&#39;field&#39; =&amp;gt; &#39;title&#39;, &#39;type&#39; =&amp;gt; &#39;value&#39;),&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&#39;field&#39; =&amp;gt; &#39;status&#39;, &#39;type&#39; =&amp;gt; &#39;value&#39;),&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function beforeFilter() {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;set(&#39;statuses&#39;, $this-&amp;gt;Ticket-&amp;gt;statuses);&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;set(&#39;categories&#39;, $this-&amp;gt;Ticket-&amp;gt;categories);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; parent::beforeFilter();&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* index method&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @return void&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function index() {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Prg-&amp;gt;commonProcess();&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;paginate = &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; array(&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;limit&#39; =&amp;gt; 2,&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;conditions&#39; =&amp;gt; $this-&amp;gt;Ticket-&amp;gt;parseCriteria($this-&amp;gt;passedArgs)&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //$this-&amp;gt;paginate[&#39;conditions&#39;] = $this-&amp;gt;Ticket-&amp;gt;parseCriteria($this-&amp;gt;passedArgs);&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;set(&#39;tickets&#39;, $this-&amp;gt;paginate());&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* view method&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @param string $id&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @return void&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function view($id = null) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Ticket-&amp;gt;id = $id;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (!$this-&amp;gt;Ticket-&amp;gt;exists()) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; throw new NotFoundException(__(&#39;Invalid ticket&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;set(&#39;ticket&#39;, $this-&amp;gt;Ticket-&amp;gt;read(null, $id));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* add method&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @return void&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function add() {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ($this-&amp;gt;request-&amp;gt;is(&#39;post&#39;)) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Ticket-&amp;gt;create();&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ($this-&amp;gt;Ticket-&amp;gt;save($this-&amp;gt;request-&amp;gt;data)) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Session-&amp;gt;setFlash(__(&#39;The ticket has been saved&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;redirect(array(&#39;action&#39; =&amp;gt; &#39;index&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Session-&amp;gt;setFlash(__(&#39;The ticket could not be saved. Please, try again.&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* edit method&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @param string $id&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @return void&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function edit($id = null) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Ticket-&amp;gt;id = $id;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (!$this-&amp;gt;Ticket-&amp;gt;exists()) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; throw new NotFoundException(__(&#39;Invalid ticket&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ($this-&amp;gt;request-&amp;gt;is(&#39;post&#39;) || $this-&amp;gt;request-&amp;gt;is(&#39;put&#39;)) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ($this-&amp;gt;Ticket-&amp;gt;save($this-&amp;gt;request-&amp;gt;data)) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Session-&amp;gt;setFlash(__(&#39;The ticket has been saved&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;redirect(array(&#39;action&#39; =&amp;gt; &#39;index&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Session-&amp;gt;setFlash(__(&#39;The ticket could not be saved. Please, try again.&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;request-&amp;gt;data = $this-&amp;gt;Ticket-&amp;gt;read(null, $id);&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* delete method&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @param string $id&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;* @return void&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function delete($id = null) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (!$this-&amp;gt;request-&amp;gt;is(&#39;post&#39;)) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; throw new MethodNotAllowedException();&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Ticket-&amp;gt;id = $id;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (!$this-&amp;gt;Ticket-&amp;gt;exists()) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; throw new NotFoundException(__(&#39;Invalid ticket&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ($this-&amp;gt;Ticket-&amp;gt;delete()) {&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Session-&amp;gt;setFlash(__(&#39;Ticket deleted&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;redirect(array(&#39;action&#39; =&amp;gt; &#39;index&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Session-&amp;gt;setFlash(__(&#39;Ticket was not deleted&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;redirect(array(&#39;action&#39; =&amp;gt; &#39;index&#39;));&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br style=&quot;font-weight: normal;&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;}&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;







&lt;span style=&quot;font-size: large;&quot;&gt;7. Make Model&amp;nbsp; &quot;Ticket.php&quot;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;











&lt;span style=&quot;font-size: large;&quot;&gt; &amp;lt; ? php&amp;nbsp; &lt;br /&gt;App::uses(&#39;AppModel&#39;, &#39;Model&#39;);&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;* Ticket Model&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;class Ticket extends AppModel {&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;* Display field&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* @var string&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public $displayField = &#39;title&#39;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public $actsAs = array(&#39;Search.Searchable&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public $filterArgs = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&#39;name&#39; =&amp;gt; &#39;title&#39;, &#39;type&#39; =&amp;gt; &#39;query&#39;,&#39;method&#39;=&amp;gt;&#39;filterTitle&#39;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&#39;name&#39; =&amp;gt; &#39;status&#39;, &#39;type&#39; =&amp;gt; &#39;string&#39;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;/**&lt;br /&gt;construct *&lt;br /&gt;&amp;nbsp;* @return void&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function __construct($id = false,$table = null,$ids = null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;statuses = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;open&#39; =&amp;gt; __(&#39;Open&#39;,true),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;closed&#39; =&amp;gt; __(&#39;Closed&#39;,true),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;categories = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;bug&#39; =&amp;gt; __(&#39;bug&#39;,true),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;support&#39; =&amp;gt; __(&#39;support&#39;,true),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;technical&#39; =&amp;gt; __(&#39;technical&#39;,true),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;other&#39; =&amp;gt; __(&#39;other&#39;,true),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; parent::__construct($id,$table,$ids);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;* filterTitle method&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* @return void&lt;br /&gt;&amp;nbsp;*/&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function filterTitle($data = array()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $filter = $data[&#39;title&#39;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(empty($filter))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return array();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $cond = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;OR&#39; =&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;alias . &#39;.title LIKE&#39; =&amp;gt; &#39;%&#39; . $filter . &#39;%&#39;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $cond;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;}&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;
&lt;span style=&quot;font-size: large;&quot;&gt;








&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;8. Make a View File in app/View/Tickets/&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;



&lt;span style=&quot;font-size: large;&quot;&gt;







&amp;nbsp;&amp;nbsp;&amp;nbsp; You have to create view file like index.ctp , add.ctp , edit.ctp , view.ctp by using cakebake.&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;


&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&amp;nbsp; &amp;nbsp; After creating above file,put below code in your index.ctp.&lt;/span&gt;&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;/h1&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt; ? php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo $this-&amp;gt;Form-&amp;gt;create(&#39;Ticket&#39;, array(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;url&#39; =&amp;gt; array_merge(array(&#39;action&#39; =&amp;gt; &#39;index&#39;), $this-&amp;gt;params[&#39;pass&#39;])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo $this-&amp;gt;Form-&amp;gt;input(&#39;title&#39;, array(&#39;div&#39; =&amp;gt; false,&#39;empty&#39;=&amp;gt;true));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo $this-&amp;gt;Form-&amp;gt;input(&#39;status&#39;, array(&#39;div&#39; =&amp;gt; false,&#39;empty&#39;=&amp;gt;true));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo $this-&amp;gt;Form-&amp;gt;submit(__(&#39;Search&#39;, true), array(&#39;div&#39; =&amp;gt; false));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo $this-&amp;gt;Form-&amp;gt;end();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ? &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;9. Put below code in app/Plugin/Search/Config&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;/bootstrap.php&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt; ? php &amp;nbsp;&amp;nbsp; &lt;br /&gt;define(&quot;PLUGIN_DIR&quot;, CakePlugin::path(&#39;Search&#39;));&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: #ead1dc; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;















&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;


&lt;span style=&quot;font-size: large;&quot;&gt;












&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;


&lt;span style=&quot;font-size: large;&quot;&gt;10. Try to run your application.&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;











&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;


&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;








&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks to all&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/h1&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/6322214368007537666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/06/search-plugin-demo-in-cakephp-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/6322214368007537666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/6322214368007537666'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/06/search-plugin-demo-in-cakephp-20.html' title='Simple DEMO of Search plugin in Cakephp 2.0'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-7526769296478685165</id><published>2012-05-05T01:48:00.001-07:00</published><updated>2012-08-31T00:01:01.614-07:00</updated><title type='text'>Virtual Keyboard Helper in CakePHP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #e69138;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;Virtual Keyboard Helper in CakePHP&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;1. How to Use it&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;-- Include below helper in your controller&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;
var $helpers = array(&#39;Keyboard&#39;);&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;-- in your ctp file, write below code&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;!--?&lt;br--&gt;echo $this-&amp;gt;Keyboard-&amp;gt;generate();&lt;br /&gt;
?&amp;gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;2.How to&amp;nbsp; Make Virtual Keyboard Helper&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
-- Put below helper file&amp;nbsp; in views/helper/keyboard.php &lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;!--?php&lt;br--&gt;&lt;br /&gt;
class KeyboardHelper extends Helper {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var $helpers = array(&#39;Html&#39;, &#39;Javascript&#39;, &#39;Form&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function generate()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $html = array();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $html[] = $this-&amp;gt;Html-&amp;gt;css(&#39;keyboard&#39;);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $html[] =&amp;nbsp; $this-&amp;gt;Javascript-&amp;gt;link(&#39;keyboard&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $html[] = $this-&amp;gt;Form-&amp;gt;input(&#39;keyboardddddd&#39;, array(&#39;class&#39;=&amp;gt;&#39;keyboardInput&#39;,&#39;label&#39;=&amp;gt;false,&#39;div&#39;=&amp;gt;false,&#39;type&#39; =&amp;gt; &#39;textarea&#39;,&#39;value&#39;=&amp;gt;&#39;&#39;));&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;\n&quot; . implode(&quot;\n&quot;, $html);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;3. How to get library of Virtual Keyboard Helper&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
-- javascript code :&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.greywyvern.com/code/javascript/keyboard.js&quot;&gt;http://www.greywyvern.com/code/javascript/keyboard.js&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-- css code :&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.greywyvern.com/code/javascript/keyboard.css&quot;&gt;http://www.greywyvern.com/code/javascript/keyboard.css&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-- image&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.greywyvern.com/code/javascript/keyboard.png&quot;&gt;http://www.greywyvern.com/code/javascript/keyboard.png&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference site :&lt;br /&gt;
&lt;a href=&quot;http://www.greywyvern.com/code/javascript/keyboard&quot;&gt;http://www.greywyvern.com/code/javascript/keyboard&lt;/a&gt; &lt;br /&gt;
Thanks to him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/7526769296478685165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/05/virtual-keyboard-helper-in-cakephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/7526769296478685165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/7526769296478685165'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/05/virtual-keyboard-helper-in-cakephp.html' title='Virtual Keyboard Helper in CakePHP'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-8393451471181764570</id><published>2012-04-19T23:57:00.006-07:00</published><updated>2012-08-31T00:01:39.113-07:00</updated><title type='text'>Import Model  in Controller</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How Many Time &lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;Accessing a model in AppController or in any Controllers&lt;/u&gt;?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;1. &lt;b&gt;var $uses = array(&#39;ModelName&#39;);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;b&gt;$this-&amp;gt;loadModel(&#39;ModelName&#39;);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;b&gt;$this-&amp;gt;ModelName = ClassRegistry::init(&#39;ModelName&#39;);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;4. &lt;b&gt;App::import(&#39;Model&#39;, &#39;ModelName&#39;);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to Use it :&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;b&gt;$this-&amp;gt;ModelName-&amp;gt;find();&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/8393451471181764570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/import-model-in-controller.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/8393451471181764570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/8393451471181764570'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/import-model-in-controller.html' title='Import Model  in Controller'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-1255976987988500647</id><published>2012-04-12T21:44:00.003-07:00</published><updated>2012-08-31T00:02:20.485-07:00</updated><title type='text'>Find in View in Cakephp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #cc0000;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;How to Use Find Query in View in CakePHP ?&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;1. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Inside your Menu model create a method, something like getMenu()&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;function getMenu()&lt;br /&gt;{&lt;br /&gt;$test&amp;nbsp; = array();&lt;br /&gt;$test = $this-&amp;gt;Menu-&amp;gt;find(&#39;all&#39;);&lt;br /&gt;return $test;&lt;br /&gt;}&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;In this method do your find() and get the results you want. Modify the results as you need and like to within the getMenu() method and return the data.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;If you need that menu on every page in AppController::beforeFilter() or beforeRender() simply do&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span style=&quot;color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;$this-&amp;gt;set(&#39;menu&#39;, ClassRegistry::init(&#39;Menu&#39;)-&amp;gt;getMenu());&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;If you do not need it everywhere you might go better with using&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://api20.cakephp.org/class/object#method-ObjectrequestAction&quot; rel=&quot;nofollow&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #4a6b82; cursor: pointer; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;requestAction&lt;/a&gt;&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;getting the data using this method from the Menus controller that will call getMenu() from the model and return the data. Setting it where you need it would be still better, if you use requestAction you also want to cache it very likely.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;2.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;b style=&quot;color: red;&quot;&gt;NOTE : &lt;/b&gt;This Way &lt;/span&gt;&lt;i style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: italic; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;b style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;VIOLATE&amp;nbsp; The MVC RULE&lt;/b&gt;&lt;/i&gt;&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
In AppHelper ,&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
Make a below function&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; border-width: 0px; clear: both; color: black; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px 0px 1em; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
&amp;nbsp;function getMenu()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; App::import(&#39;Model&#39;, &#39;Menu&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;Menu= &amp;amp;new Menu();&lt;br /&gt;
$test&amp;nbsp; = array();&lt;br /&gt;
$test = $this-&amp;gt;Menu-&amp;gt;find(&#39;all&#39;);&lt;br /&gt;
return $test;&lt;br /&gt;
}&lt;/div&gt;
&lt;div style=&quot;background-color: white; border-width: 0px; clear: both; color: black; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px 0px 1em; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Use above function in view like :&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-color: #ead1dc; border-width: 0px; color: black; font-family: Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px 0px 10px; max-height: 600px; orphans: 2; overflow: auto; padding: 5px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; widows: 2; width: auto; word-spacing: 0px;&quot;&gt;&lt;code style=&quot;border-width: 0px; font-family: Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border-width: 0px; color: black; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
 $menu = $html-&amp;gt;getMenu();
 print_r($menu);

 ?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-color: #eeeeee; border-width: 0px; color: black; font-family: Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px 0px 10px; max-height: 600px; orphans: 2; overflow: auto; padding: 5px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; widows: 2; width: auto; word-spacing: 0px;&quot;&gt;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border-width: 0px; color: black; font-size: 14px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border-width: 0px; clear: both; color: black; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px 0px 1em; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/1255976987988500647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/find-in-view-in-cakephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/1255976987988500647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/1255976987988500647'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/find-in-view-in-cakephp.html' title='Find in View in Cakephp'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-2202354843346997442</id><published>2012-04-12T03:34:00.002-07:00</published><updated>2012-08-31T00:02:57.791-07:00</updated><title type='text'>Self Association in CakePHP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;


&lt;span style=&quot;font-size: large;&quot;&gt;
How to Create Self Association in CakePHP&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;



&lt;/h2&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt; ? php&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class Post extends AppModel {&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; var $name = &#39;Post&#39;;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var $belongsTo = array(&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;Parent&#39; =&amp;gt; array(&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;className&#39; =&amp;gt; &#39;Post&#39;,&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &#39;foreignKey&#39; =&amp;gt; &#39;parent_id&#39;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; )&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var $hasMany = array(&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &#39;Children&#39; =&amp;gt; array(&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &#39;className&#39; =&amp;gt; &#39;Post&#39;,&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;foreignKey&#39; =&amp;gt; &#39;parent_id&#39;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ?&amp;gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;



&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Fetching a nested array of associated records:&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
If your table has &lt;code&gt;parent_id&lt;/code&gt; field you can also use &lt;a href=&quot;http://book.cakephp.org/view/1023/find-threaded&quot;&gt;&lt;code&gt;find(&#39;threaded&#39;)&lt;/code&gt;&lt;/a&gt; to fetch nested array of records using a single query without setting up any associations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px none; color: #0b5394; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 23px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;Mail me on &quot;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large; font-weight: normal;&quot;&gt;chetanspeed511987@gmail.com&lt;/span&gt;&lt;span style=&quot;font-size: large; font-weight: normal;&quot;&gt;&quot; if any query for same.&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/2202354843346997442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/self-association-in-cakephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/2202354843346997442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/2202354843346997442'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/self-association-in-cakephp.html' title='Self Association in CakePHP'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-2391964962287394216</id><published>2012-04-10T21:33:00.002-07:00</published><updated>2012-04-10T21:33:36.895-07:00</updated><title type='text'>Difference between Component and Plugin in Cakephp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-family: &#39;Trebuchet MS&#39;, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin-bottom: 7px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Difference between a “component” and a “plugin” in cakephp &lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border-width: 0px; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
Components and Plugins are still separate entities in Cake 2.0.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://book.cakephp.org/2.0/en/controllers/components.html&quot; rel=&quot;nofollow&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #4a6b82; cursor: pointer; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;According to the manual&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;components are &quot;are packages of logic that are shared between controllers&quot;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://book.cakephp.org/2.0/en/plugins.html&quot; rel=&quot;nofollow&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #4a6b82; cursor: pointer; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;whereas plugins&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;are &quot;a combination of controllers, models, and views&quot;. Compoments extend the base Component class, while Plugins have their own AppModel and AppController.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
Think of a plugin as a separate Cake application sharing the same core libraries with your main application.&lt;/div&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border-width: 0px; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border-width: 0px; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/2391964962287394216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/difference-between-component-and-plugin.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/2391964962287394216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/2391964962287394216'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/difference-between-component-and-plugin.html' title='Difference between Component and Plugin in Cakephp'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-3694762381414616672</id><published>2012-04-09T03:37:00.000-07:00</published><updated>2012-04-10T01:53:39.681-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mobile.Cakephp"/><title type='text'>MobileSite in Cakephp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: red; font-size: large;&quot;&gt;&amp;nbsp;Make Mobile site in Cakephp&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #334455; font-family: Skolar-1,Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin: 0px 0px 0.75em; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #334455; font-family: Skolar-1,Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin: 0px 0px 0.75em; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
I could say an endless number of good things about CakePHP, my framework of choice for database-driven sites, but after two years of working with it, I return endlessly to a single bad thing: the official documentation is maddening.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://book.cakephp.org/&quot; style=&quot;-webkit-transition-delay: initial; -webkit-transition-duration: 0.2s; -webkit-transition-property: all; -webkit-transition-timing-function: linear; border-bottom-color: rgb(208, 220, 223); border-bottom-style: solid; border-bottom-width: 1px; color: #556677; text-decoration: none;&quot;&gt;The cookbook&lt;/a&gt;remains slightly hostile to all but the most advanced coders. Most sections are deliberately obtuse on certain points, like a puzzle box that provides a description of each piece but never shows you a picture of what the top left corner ought to look like.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
The result is that we beta coders flail for a while when tackling a new problem in Cake, before finally discovering that the solution was far simpler than we originally thought. Case in point: optimizing a Cake site for mobile devices. As my latest CakePHP project needed both a standard site and a mobile version optimized for the iPhone/iPod Touch and other mobile webkit browsers, I spent a few days browsing through plugins and components, thinking I’d need some additional horsepower to create a robust mobile web app along side the usual browser fare. In the end, however, I found everything I needed inside Cake itself.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
I needed to do two things:&lt;/div&gt;
&lt;ol style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 3em; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;font-size: 1em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Detect webkit-based mobile browsers&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;font-size: 1em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Automatically serve those browsers a mobile optimized page&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;if one was available for the requested action&lt;/i&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Here’s how I did it, and how you might, too.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; display: block; font-family: MyriadPro-BoldCond, Futura-CondensedMedium, Impact, sans-serif; font-size: 1.5em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 0.75; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.75em; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: uppercase; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 57px;&quot; width=&quot;57&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 33px;&quot; width=&quot;33&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 76px;&quot; width=&quot;76&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 72px;&quot; width=&quot;72&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 90px;&quot; width=&quot;90&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 98px;&quot; width=&quot;98&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 40px;&quot; width=&quot;40&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 82px;&quot; width=&quot;82&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 86px;&quot; width=&quot;86&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 71px;&quot; width=&quot;71&quot;&gt;&lt;/canvas&gt;&lt;/h3&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Cake’s RequestHandler component includes a nifty method for detecting mobile browsers —&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #e0e4e8; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; border-top-left-radius: 2px; border-top-right-radius: 2px; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 1.1em; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em; padding-left: 0.2em; padding-right: 0.2em; padding-top: 0.2em;&quot;&gt;$this-&amp;gt;RequestHandler-&amp;gt;isMobile()&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;— but the default list of devices detected by Cake 1.2 is a bit dated.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Fortunately, it’s easy to update. The default list of device names is found in the RequestHandler component’s core file,&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;cake/libs/controller/components/request_handler.php&lt;/i&gt;:&lt;/div&gt;
&lt;pre style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(208, 220, 223); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(208, 220, 223); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(208, 220, 223); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(208, 220, 223); border-top-style: solid; border-top-width: 1px; color: #334455; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 2em; margin-left: 0px; margin-right: 0px; margin-top: 2em; orphans: 2; overflow-x: auto; overflow-y: auto; padding-bottom: 0.75em; padding-left: 0.75em; padding-right: 0.75em; padding-top: 0.75em; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;if (!defined(&#39;REQUEST_MOBILE_UA&#39;)) {
    define(&#39;REQUEST_MOBILE_UA&#39;, &#39;(iPhone|MIDP|AvantGo|BlackBerry|J2ME|Opera Mini|DoCoMo|NetFront|Nokia|PalmOS|PalmSource|portalmmm|Plucker|ReqwirelessWeb|SonyEricsson|Symbian|UP\.Browser|Windows CE|Xiino)&#39;);
}&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Update this by copying it to your core configuration file —&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;/app/config/core.php&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;— and adding the device names of your choice. I simply added&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;Android&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;to snag all those new Google-happy devices using webkit browsers. To wit:&lt;/div&gt;
&lt;pre style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(208, 220, 223); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(208, 220, 223); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(208, 220, 223); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(208, 220, 223); border-top-style: solid; border-top-width: 1px; color: #334455; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 2em; margin-left: 0px; margin-right: 0px; margin-top: 2em; orphans: 2; overflow-x: auto; overflow-y: auto; padding-bottom: 0.75em; padding-left: 0.75em; padding-right: 0.75em; padding-top: 0.75em; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;   define(&#39;REQUEST_MOBILE_UA&#39;, &#39;(Android|iPhone|MIDP|AvantGo|BlackBerry|J2ME|Opera Mini|DoCoMo|NetFront|Nokia|PalmOS|PalmSource|portalmmm|Plucker|ReqwirelessWeb|SonyEricsson|Symbian|UP\.Browser|Windows CE|Xiino)&#39;);&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; display: block; font-family: MyriadPro-BoldCond, Futura-CondensedMedium, Impact, sans-serif; font-size: 1.5em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 0.75; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.75em; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: uppercase; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 57px;&quot; width=&quot;57&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 36px;&quot; width=&quot;36&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 72px;&quot; width=&quot;72&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 71px;&quot; width=&quot;71&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 40px;&quot; width=&quot;40&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 50px;&quot; width=&quot;50&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 60px;&quot; width=&quot;60&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 75px;&quot; width=&quot;75&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 58px;&quot; width=&quot;58&quot;&gt;&lt;/canvas&gt;&lt;/h3&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
There are several places you could put mobile view files —&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;app/views/elements&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;or&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;app/views/themed&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;come to mind — but I decided on something slightly different. Cake automatically looks for an action’s view files inside a view folder named after the action’s controller. For instance, a page request for&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;users/login&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;expects to find a view file at&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;/app/views/users/login.ctp&lt;/i&gt;. Given that, I extended the convention by creating a subfolder named&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;mobile&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;inside each controller’s existing view folder. So, my mobile view for&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;users/login&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is located at&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;/app/views/users/mobile/login.ctp&lt;/i&gt;.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; display: block; font-family: MyriadPro-BoldCond, Futura-CondensedMedium, Impact, sans-serif; font-size: 1.5em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 0.75; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.75em; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: uppercase; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 57px;&quot; width=&quot;57&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 35px;&quot; width=&quot;35&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 75px;&quot; width=&quot;75&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 32px;&quot; width=&quot;32&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 75px;&quot; width=&quot;75&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 76px;&quot; width=&quot;76&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 43px;&quot; width=&quot;43&quot;&gt;&lt;/canvas&gt;&lt;/h3&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Mobile-optimized pages will need a different layout than standard pages. Create a file named mobile.ctp and save it inside /&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;app/views/layouts&lt;/i&gt;.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; display: block; font-family: MyriadPro-BoldCond, Futura-CondensedMedium, Impact, sans-serif; font-size: 1.5em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 0.75; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.75em; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: uppercase; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 57px;&quot; width=&quot;57&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 35px;&quot; width=&quot;35&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 75px;&quot; width=&quot;75&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 49px;&quot; width=&quot;49&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 63px;&quot; width=&quot;63&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 49px;&quot; width=&quot;49&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 98px;&quot; width=&quot;98&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 52px;&quot; width=&quot;52&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 58px;&quot; width=&quot;58&quot;&gt;&lt;/canvas&gt;&lt;canvas height=&quot;31&quot; style=&quot;height: 31px; left: -1px; position: relative !important; top: -5px; width: 72px;&quot; width=&quot;72&quot;&gt;&lt;/canvas&gt;&lt;/h3&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
Here’s where Cake really shines. All we need to do in order to send all mobile devices to any mobile-optimized pages is create the following logic inside the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #e0e4e8; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; border-top-left-radius: 2px; border-top-right-radius: 2px; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 1.1em; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em; padding-left: 0.2em; padding-right: 0.2em; padding-top: 0.2em;&quot;&gt;beforeFilter()&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;of&lt;i style=&quot;font-style: italic; font-weight: inherit;&quot;&gt;/app/app_controller.php&lt;/i&gt;.&lt;/div&gt;
&lt;pre style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(208, 220, 223); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(208, 220, 223); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(208, 220, 223); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(208, 220, 223); border-top-style: solid; border-top-width: 1px; color: #334455; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin-bottom: 2em; margin-left: 0px; margin-right: 0px; margin-top: 2em; orphans: 2; overflow-x: auto; overflow-y: auto; padding-bottom: 0.75em; padding-left: 0.75em; padding-right: 0.75em; padding-top: 0.75em; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;        // check for mobile devices
        if ($this-&amp;gt;RequestHandler-&amp;gt;isMobile()) {
            // if device is mobile, change layout to mobile
            $this-&amp;gt;layout = &#39;mobile&#39;;
            // and if a mobile view file has been created for the action, serve it instead of the default view file
            $mobileViewFile = VIEWS . strtolower($this-&amp;gt;params[&#39;controller&#39;]) . &#39;/mobile/&#39; . $this-&amp;gt;params[&#39;action&#39;] . &#39;.ctp&#39;;
            if (file_exists($mobileViewFile)) {
                $mobileView = strtolower($this-&amp;gt;params[&#39;controller&#39;]) . &#39;/mobile/&#39;;
                $this-&amp;gt;viewPath = $mobileView;
            }
        }
&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
This code does the following:&lt;/div&gt;
&lt;ol style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 3em; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Detects mobile browsers using our updated device list&lt;/li&gt;
&lt;li style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Changes the layout to our new mobile layout&lt;/li&gt;
&lt;li style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Checks to see if a mobile view file exists inside the mobile subfolder described above.&lt;/li&gt;
&lt;li style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 0.25em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;If the file exists, the logic changes to the mobile view before displaying the page.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #334455; font-family: Skolar-1, Skolar-2; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 26px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
One thing to keep in mind about this approach is that it doesn’t allow mobile viewers to switch back to the standard browser view, assuming instead that you’ll take care to retain all essential functions in your mobile views. It does, however, preserve your original URLs across all platforms, with none of that ganky mobile redirection that lesser sites use.&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/3694762381414616672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/mobilesite-in-cakephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3694762381414616672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3694762381414616672'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/mobilesite-in-cakephp.html' title='MobileSite in Cakephp'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-4368978087205579620</id><published>2012-04-08T03:32:00.000-07:00</published><updated>2012-04-09T03:59:11.362-07:00</updated><title type='text'>What’s new</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 class=&quot;entry-heading&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; clear: both; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 28px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.4em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;a href=&quot;http://www.codeforest.net/cakephp-2-0-released-whats-new&quot; rel=&quot;bookmark&quot; style=&quot;border-bottom-style: none; border-color: initial; border-image: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; color: #222222; text-decoration: none;&quot; title=&quot;Permanent Link: CakePHP 2.0 released: What’s new?&quot;&gt;CakePHP 2.0 released: What’s new?&lt;/a&gt;&lt;/h1&gt;
&lt;h1 class=&quot;entry-heading&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial,Helvetica,sans-serif; font-size: 28px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.4em; margin: 0px; orphans: 2; padding: 0px 0px 5px; position: relative; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;&lt;/h1&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: Georgia, Times, &#39;Times New Roman&#39;, serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 23px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0.5em; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
“CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code. ”&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: Georgia, Times, &#39;Times New Roman&#39;, serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 23px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0.5em; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
And now, it even got better. After a year and a half of coding, CakePHP 2.0 is released.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: Georgia, Times, &#39;Times New Roman&#39;, serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 23px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0.5em; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
I will first talk about some cool new features and explain some of them later.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: black; font-family: Georgia,Times,&#39;Times New Roman&#39;,serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 23px; margin: 0px; orphans: 2; padding: 0.5em 0px; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;New features&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Georgia,Times,&#39;Times New Roman&#39;,serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 23px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Dropped PHP 4 support and we have refactored all the code to be strictly compliant with PHP 5.2+.&lt;br /&gt;Use of native features like exceptions, PDO, SPL, json_encode and much more.&lt;br /&gt;Embraced the PSR-0 recommendation for file naming. Now all your classes map to a file with the same name. Less things to remember!&lt;br /&gt;New Error and Exception handlers provide easier to configure, and ease working with errors such as page not found, unauthorized error and lots more.&lt;br /&gt;Improved I18n functions for easier multilingual development.&lt;br /&gt;Support for injecting your own objects to act as CakePHP libraries, such as component, helpers and behaviors, no more excuses for modifying core files.&lt;br /&gt;Console libraries rebuilt from scratch, automatic help generation, parameter checking, and colors!&lt;br /&gt;New Request and Response objects for easier handling of HTTP requests.&lt;br /&gt;Better session handling for easier custom engines. Put your sessions into storage systems like Memcache with less effort.&lt;br /&gt;Completely refactored Auth system. It is now easier to configure and plug in your own implementations for external login services or your permissions system.&lt;br /&gt;Brand new email library with support for multiple transports. With easy to use global configuration, logging, and charset support.&lt;br /&gt;Dropped SimpleUnit in favor of PHPUnit. PHPUnit is the defacto testing framework for PHP with support for more options, better mock objects, and improved console output [16]&lt;br /&gt;Reworked the SecurityComponent to suck less, now you can more easily protect your apps against CSRF and form tampering attacks while having fun.&lt;br /&gt;Improved support for PostgreSql, SQLite and SqlServer, they are now first class citizens along with Mysql datasource.&lt;br /&gt;HTML 5 form inputs support in form helper.&lt;br /&gt;A Sexier default look taking advantage of new CSS 3 features.&lt;br /&gt;A lot faster, almost everything is now lazy-loaded, and even on debug mode you will feel your applications flying.&lt;br /&gt;CakePHP 2.0 completely dropped the PHP 4 support and is now supporting PHP 5.2.6 and above. This was expected.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;Models&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The model construction process has been made lighter. Model associations are now lazy loaded, applications with lots of models and associations will see great time reductions in the bootstrap process.&lt;br /&gt;Now models won’t require a database connection in the construction process. The database will be accessed for the first time only when a find operation is issued or information for one of the columns is required.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Views&lt;/span&gt;&lt;br /&gt;View will now always have the last rendered content (view or layout) accessible through $this-&amp;gt;output. In helpers you can use $this-&amp;gt;_View-&amp;gt;output. Modifying this property will change the content that comes out of the view rendering.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Helpers&lt;/span&gt;&lt;br /&gt;There are some interesting new features inside powerful CakePHP Helpers:&lt;br /&gt;FormHelper now supports all HTML5 input types and custom input types. Just use the input type you want as the method on the helper. For example range() would create an input with type = range.&lt;br /&gt;postLink() and postButton() Creates link/button to access some page using HTTP method POST. With this, in your controller you can avoid some action, like delete, to be accessed by GET method.&lt;br /&gt;select() with multiple = checkbox, now treats the &#39;id&#39; attribute as a prefix for all the generated options.&lt;br /&gt;getCrumbsList() Creates breadcrumb links wrapped in elements in HTMLHelper&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Error handling&lt;/span&gt;&lt;br /&gt;The error handling implementation has dramatically changed in 2.0. Exceptions have been introduced throughout the framework, and error handling has been updated to offer more control and flexibility.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;PHPUnit&lt;/span&gt;&lt;br /&gt;All of the core test cases and supporting infrastructure have been ported to use PHPUnit 3.5. Of course you can continue to use SimpleTest in your application by replacing the related files.&lt;br /&gt;No further support will be given for SimpleTest and it is recommended that you migrate to PHPUnit as well.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Database Objects&lt;/span&gt;&lt;br /&gt;Cake 2.0 introduces some changes to Database objects that should not greatly affect backwards compatibility. The biggest one is the adoption of PDO for handling database connections.&lt;br /&gt;If you are using a vanilla installation of PHP 5 you will already have installed the needed extensions, but you may need to activate individual extensions for each driver you wish to use.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Console&lt;/span&gt;&lt;br /&gt;CakePHP features not only a web framework but also a console framework for creating console applications. Console applications are ideal for handling a variety of background tasks such as maintenance, and completing work outside of the request-response cycle. CakePHP console applications allow you to reuse your application classes from the command line.&lt;br /&gt;CakePHP comes with a number of console applications out of the box. Some of these applications are used in concert with other CakePHP features (like ACL or i18n), and others are for general use in getting you working faster.&lt;br /&gt;One of the cool things is that the console app is now colorized to easier spot error messages and other critical information. &lt;/span&gt;&lt;br /&gt;
&lt;h4 style=&quot;background-color: white; clear: both; color: #222222; font-family: Georgia,&#39;Times New Roman&#39;,Times,serif ! important; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.4em; margin: 40px 0px 0px 10px; orphans: 2; padding: 0px 0px 5px; position: relative; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; color: black; font-family: Georgia,Times,&#39;Times New Roman&#39;,serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 23px; margin: 0px; orphans: 2; padding: 0.5em 0px; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h1 class=&quot;entry-heading&quot; style=&quot;background-color: white; clear: both; color: #222222; font-family: Arial,Helvetica,sans-serif; font-size: 28px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.4em; margin: 0px; orphans: 2; padding: 0px 0px 5px; position: relative; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&amp;nbsp;&lt;/h1&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/4368978087205579620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/whats-new.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/4368978087205579620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/4368978087205579620'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/whats-new.html' title='What’s new'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-5194468661094302938</id><published>2012-04-07T00:17:00.002-07:00</published><updated>2012-04-07T04:10:33.735-07:00</updated><title type='text'>Internationalization &amp; Localization</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;Internationalization &amp;amp; Localization&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; display: inline ! important; float: none; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;One of the best ways for your applications to reach a larger audience is to cater for multiple languages. This can often prove to be a daunting task, but the internationalization and localization features in CakePHP make it much easier.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: #c92434; font-family: MuseoSlab500,Helvetica,Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.25; margin: 0px 0px 9px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;Internationalizing Your Application&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: #c92434; font-family: MuseoSlab500,Helvetica,Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.25; margin: 0px 0px 9px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;There are only a few steps to go from a single-language application to a multi-lingual application, the first of which is to make use of the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; title=&quot;__&quot;&gt;&lt;tt class=&quot;xref php php-func docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__()&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;function in your code. Below is an example of some code for a single-language application:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;x&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;h2&gt;

Posts&lt;/h2&gt;
&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;To internationalize your code, all you need to do is to wrap strings in&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; title=&quot;__&quot;&gt;&lt;tt class=&quot;xref php php-func docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__()&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;like so:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;x&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;h2&gt;

&lt;span class=&quot;cp&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #666666; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;Posts&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;cp&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #666666; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;If you do nothing further, these two code examples are functionally identical - they will both send the same content to the browser. The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; title=&quot;__&quot;&gt;&lt;tt class=&quot;xref php php-func docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__()&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;function will translate the passed string if a translation is available, or return it unmodified. It works similar to other&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://en.wikipedia.org/wiki/Gettext&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;Gettext&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;implementations (as do the other translate functions, such as&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__d&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; title=&quot;__d&quot;&gt;&lt;tt class=&quot;xref php php-func docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__d()&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__n&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; title=&quot;__n&quot;&gt;&lt;tt class=&quot;xref php php-func docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__n()&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;etc)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;With your code ready to be multilingual, the next step is to create your&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://en.wikipedia.org/wiki/Gettext&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;pot file&lt;/a&gt;, which is the template for all translatable strings in your application. To generate your pot file(s), all you need to do is run the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/console-and-shells.html&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;i style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;i18n console task&lt;/i&gt;&lt;/a&gt;, which will look for where you’ve used a translate function in your code and generate your pot file(s) for you. You can and should re-run this console task any time you change the translations in your code.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The pot file(s) themselves are not used by CakePHP, they are the templates used to create or update your&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://en.wikipedia.org/wiki/Gettext&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;po files&lt;/a&gt;, which contain the translations. Cake will look for your po files in the following location:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;x&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/app/Locale/&lt;locale&gt;/LC_MESSAGES/&lt;domain&gt;.po&lt;/domain&gt;&lt;/locale&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The default domain is ‘default’, therefore your locale folder would look something like this:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;x&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/app/Locale/eng/LC_MESSAGES/default.po (English)&lt;/span&gt;
&lt;span class=&quot;x&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/app/Locale/fre/LC_MESSAGES/default.po (French)&lt;/span&gt;
&lt;span class=&quot;x&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/app/Locale/por/LC_MESSAGES/default.po (Portuguese)&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;To create or edit your po files it’s recommended that you do&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;not&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;use your favorite editor. To create a po file for the first time it is possible to copy the pot file to the correct location and change the extension&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;however&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;unless you’re familiar with their format, it’s quite easy to create an invalid po file or to save it as the wrong charset (if you’re editing manually, use UTF-8 to avoid problems). There are free tools such as&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://www.poedit.net/&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;PoEdit&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;which make editing and updating your po files an easy task; especially for updating an existing po file with a newly updated pot file.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The three-character locale codes conform to the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://www.loc.gov/standards/iso639-2/php/code_list.php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;ISO 639-2&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;standard, although if you create regional locales (en_US, en_GB, etc.) cake will use them if appropriate.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Remember that po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages - you should consider implementing a different solution. e.g.:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #666666; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #5f5f5f; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// App Controller Code.&lt;/span&gt;
&lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #bf4f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;beforeFilter&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$locale&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;Config.language&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$locale&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #007020; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;file_exists&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;VIEWS&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$locale&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DS&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;viewPath&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #5f5f5f; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// e.g. use /app/View/fre/Pages/tos.ctp instead of /app/View/Pages/tos.ctp&lt;/span&gt;
        &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;viewPath&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$locale&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DS&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;viewPath&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;or:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #666666; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #5f5f5f; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// View code&lt;/span&gt;
&lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;Config.language&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;/tos&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: #c92434; font-family: MuseoSlab500,Helvetica,Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.25; margin: 0px 0px 9px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: #c92434; font-family: MuseoSlab500,Helvetica,Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.25; margin: 0px 0px 9px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;Localization in CakePHP&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: #c92434; font-family: MuseoSlab500,Helvetica,Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.25; margin: 0px 0px 9px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;To change or set the language for your application, all you need to do is the following:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #666666; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;Config.language&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;fre&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This tells Cake which locale to use (if you use a regional locale, such as fr_FR, it will use the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://www.loc.gov/standards/iso639-2/php/code_list.php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;ISO 639-2&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;locale as a fallback if it doesn’t exist), you can change the language at any time during a request. e.g. in your bootstrap if you’re setting the application default language, in your (app) controller beforeFilter if it’s specific to the request or user, or in fact anytime at all before you want a message in a different language. To set the language for the current user, you can store the setting in the Session object, like this:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #666666; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Session&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;Config.language&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;fre&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;At the beginning of each request in your controller’s&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;tt class=&quot;docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;beforeFilter&lt;/span&gt;&lt;/tt&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;you should configure&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;tt class=&quot;docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure&lt;/span&gt;&lt;/tt&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;as well:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;pre style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: #f2f2f2; border-width: 0px; box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15) inset; color: #222222; font-family: &#39;Bitstream Vera Sans Mono&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 15px; margin: 0px 0px 18px; overflow-x: auto; padding: 8px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #666666; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;AppController&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Controller&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #a71d5d; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: italic; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #bf4f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;beforeFilter&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #c44f24; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Configure&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;Config.language&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #234aa0; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Session&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #794938; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #080808; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #0b6125; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;Config.language&#39;&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Doing this will ensure that both&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;tt class=&quot;xref php php-class docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;I18n&lt;/span&gt;&lt;/tt&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/behaviors/translate.html#TranslateBehavior&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; title=&quot;TranslateBehavior&quot;&gt;&lt;tt class=&quot;xref php php-class docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TranslateBehavior&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;access the same language value.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;It’s a good idea to serve up public content available in multiple languages from a unique url - this makes it easy for users (and search engines) to find what they’re looking for in the language they are expecting. There are several ways to do this, it can be by using language specific subdomains (en.example.com, fra.example.com, etc.), or using a prefix to the url such as is done with this application. You may also wish to glean the information from the browser’s user-agent, among other things.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;As mentioned in the previous section, displaying localized content is done using the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; title=&quot;__&quot;&gt;&lt;tt class=&quot;xref php php-func docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__()&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;convenience function, or one of the other translation functions all of which are globally available, but probably be best utilized in your views. The first parameter of the function is used as the msgid defined in the .po files.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;CakePHP will automatically assume that all model validation error messages in your&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;tt class=&quot;docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$validate&lt;/span&gt;&lt;/tt&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;array are intended to be localized. When running the i18n shell these strings will also be extracted.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;There’s one other aspect of localizing your application which is not covered by the use of the translate functions, and that is date/money formats. Don’t forget that CakePHP is PHP :), therefore to set the formats for these things you need to use&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://www.php.net/setlocale&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;setlocale&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;If you pass a locale that doesn’t exist on your computer to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;reference external&quot; href=&quot;http://www.php.net/setlocale&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; color: #417282; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;setlocale&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;it will have no effect. You can find the list of available locales by running the command&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;tt class=&quot;docutils literal&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: rgba(100, 100, 100, 0.098); border-width: 0px; color: #003d4c; font-family: &#39;Bitstream Vera Sans&#39;,Consolas,Monaco,monospace; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: normal; margin: 0px; padding: 0px 1px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;locale&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pre&quot; style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; border-width: 0px; font-family: inherit; font-size-adjust: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-a&lt;/span&gt;&lt;/tt&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;in a terminal.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: black; font-family: Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; margin: 0px 0px 18px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;More Deatils : &lt;/span&gt;&lt;a href=&quot;http://book.cakephp.org/&quot;&gt;http://book.cakephp.org&lt;/a&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;h2 style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: #c92434; font-family: MuseoSlab500,Helvetica,Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.25; margin: 0px 0px 9px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;-moz-font-feature-settings: inherit; -moz-font-language-override: inherit; background-color: white; border-width: 0px; color: #c92434; font-family: MuseoSlab500,Helvetica,Arial; font-size-adjust: inherit; font-stretch: inherit; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.25; margin: 0px 0px 9px; orphans: 2; padding: 0px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;

  var _gaq = _gaq || [];
  _gaq.push([&#39;_setAccount&#39;, &#39;UA-30674832-1&#39;]);
  _gaq.push([&#39;_trackPageview&#39;]);

  (function() {
    var ga = document.createElement(&#39;script&#39;); ga.type = &#39;text/javascript&#39;; ga.async = true;
    ga.src = (&#39;https:&#39; == document.location.protocol ? &#39;https://ssl&#39; : &#39;http://www&#39;) + &#39;.google-analytics.com/ga.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/5194468661094302938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/internationalization-localization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/5194468661094302938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/5194468661094302938'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/internationalization-localization.html' title='Internationalization &amp; Localization'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-4913721948105743932</id><published>2012-04-05T21:11:00.006-07:00</published><updated>2012-04-05T21:19:17.736-07:00</updated><title type='text'>How to speed up Big site in cakephp?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Equip&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://jmeter.apache.org/&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;Apache
 JMeter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;to
 generate the load&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Enable
 profiling your web app&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://xdebug.org/docs/install&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;by
 xdebug&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; font-style: normal; font-weight: normal; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;In
 my own experience running heavy apps with CakePHP and MySQL (more
 than 250 tables) the bottleneck reside in a bad use of the CakePHP
 ORM.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; font-weight: normal; line-height: 0.19in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Sometimes,
you will fetch a lot more datas than you need.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% rgb(238, 238, 238);&quot;&gt;find(&#39;all&#39;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;function
associated to high&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% rgb(238, 238, 238);&quot;&gt;recursive&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;value
looks cool and speed up the development time.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; font-weight: normal; line-height: 0.19in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;But
in fact, this can be really awful, especially when your app and
database is growing. The number of associated models will grow too,
fetching recursively more and more datas.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; font-weight: normal; line-height: 0.19in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;A
good practice is to always specify the fields you need. Also, for
spectific queries, you should unbind associated models you don&#39;t
need.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;For
complex queries, don&#39;t hesitate to write optimized queries by hand,
using the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% rgb(238, 238, 238);&quot;&gt;query()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;function.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;In
developpment, you should enable CakePHP debug mode for profiling SQL
queries in your&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% rgb(238, 238, 238);&quot;&gt;Config/core.php&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;file
:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% rgb(238, 238, 238);&quot;&gt;Configure::write(&#39;debug&#39;,
2);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;This
will help you to find the slowest.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; font-weight: normal; line-height: 0.19in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Optimizing
your queries is the first step. If this doesn&#39;t solve your issue,
your database is maybe not well designed.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;In
addition, you should use an opcode cache in production, such
as&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://fr2.php.net/manual/en/intro.apc.php&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;APC&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;or&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://xcache.lighttpd.net/&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;XCache&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;4&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;You
 really need to get a tool like&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/jmeter/&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;jmeter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;and
 benchmark to see where your problem points will be. You can spend a
 lot of time guessing and improving, but you won&#39;t see real results
 until you measure and compare your changes.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; font-weight: normal; line-height: 0.19in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;For
example, for many years, the MySQL query cache was the solution to
all of our performance problems. If your site was slow, MySQL experts
suggested turning the query cache on. It turns out that if you have a
high write load, the cache is actually crippling. If you turned it on
without testing, you&#39;d never know.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; font-weight: normal; line-height: 0.19in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;And
don&#39;t forget that you are never done scaling. A site that handles
10req/s will need changes to support 1000req/s. And if you&#39;re lucking
enough to need to support 10,000req/s, your architecture will
probably look completely different as well.&lt;/span&gt;&lt;/div&gt;
&lt;h1 align=&quot;LEFT&quot; class=&quot;western&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; line-height: 0.25in; margin-top: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;





&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;b&gt;Databases&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ul style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Don&#39;t
 use MySQLi --&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://ca.php.net/pdo&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;PDO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;is
 the &#39;modern&#39; OO database access layer. The most important feature to
 use is placeholders in your queries. It&#39;s smart enough to use server
 side prepares and other optimizations for you as well.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; font-style: normal; font-weight: normal; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;You
 probably don&#39;t want to break your database up at this point. If you
 do find that one database isn&#39;t cutting, there are several
 techniques to scale up, depending on your app. Replicating to
 additional servers typically works well if you have more reads than
 writes. Sharding is a technique to split your data over many
 machines.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 align=&quot;LEFT&quot; class=&quot;western&quot; style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none; font-family: Verdana,sans-serif; font-style: normal; line-height: 0.25in; margin-top: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;





&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;b&gt;Caching&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ul style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;You
 probably don&#39;t want to cache in your database. The database is
 typically your bottleneck, so adding more IO&#39;s to it is typically a
 bad thing. There are several PHP caches out there that accomplish
 similar things like&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://ca.php.net/apc&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;APC&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;and
 Zend.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; font-style: normal; font-weight: normal; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Measure
 your system with caching on and off. I bet your cache is heavier
 than serving the pages straight.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;If
 it takes a long time to build your comments and article data from
 the db, integrate&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.danga.com/memcached/&quot;&gt;&lt;span style=&quot;color: #4a6b82;&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% transparent;&quot;&gt;memcache&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;into
 your system. You can cache the query results and store them in a
 memcached instance. It&#39;s important to remember that retrieving the
 data from memcache must be faster than assembling it from the
 database to see any benefit.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;LEFT&quot; style=&quot;background: none repeat scroll 0% 0% transparent; border: medium none; font-style: normal; font-weight: normal; line-height: 0.19in; margin-bottom: 0in; orphans: 2; padding: 0in; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;If
 your articles aren&#39;t dynamic, or you have simple dynamic changes
 after it&#39;s generated, consider writing out html or php to the disk.
 You could have an index.php page that looks on disk for the article,
 if it&#39;s there, it streams it to the client. If it isn&#39;t, it
 generates the article, writes it to the disk and sends it to the
 client. Deleting files from the disk would cause pages to be
 re-written. If a comment is added to an article, delete the cached
 copy -- it would be regenerated.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;5.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial, helvetica, verdana, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;You&#39;ll need a working version of CakePHP installed. This is running on 1.2.6.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://code.google.com/p/jsmin-php/&quot; style=&quot;color: #80250f; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;Download jsmin 1.1.0 or later&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and put it in vendors/jsmin.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://csstidy.sourceforge.net/&quot; style=&quot;color: #80250f; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;Download CSSTidy 1.3 or later&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and put the contents in vendors/csstidy.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://github.com/mcurry/cakephp/tree/master/helpers/asset&quot; style=&quot;color: #80250f; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;Download the helper&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and unzip it to app/views/helpers.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Include the helper in any controller that will need it. Most likely you will put it in AppController so that it&#39;s available to all your controllers:&lt;div class=&quot;dp-highlighter&quot; style=&quot;background-color: #e7e5dc; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 12px; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 18px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 1px; width: 717px;&quot;&gt;
&lt;div class=&quot;bar&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 45px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;div class=&quot;tools&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; color: silver; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 9px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 8px; padding-top: 3px;&quot;&gt;
&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot; style=&quot;background-color: white; color: #5c5c5c; list-style-image: initial; list-style-position: initial; list-style-type: decimal-leading-zero; margin-bottom: 1px; margin-left: 45px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li class=&quot;alt&quot; style=&quot;background-color: white; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot; style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;$helpers&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;array&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;Asset.Asset&#39;&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;In your layout and views include Javascript files as you normally would when using the $scripts_for_layout approach:&lt;div class=&quot;dp-highlighter&quot; style=&quot;background-color: #e7e5dc; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 12px; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 18px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 1px; width: 717px;&quot;&gt;
&lt;div class=&quot;bar&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 45px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;div class=&quot;tools&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; color: silver; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 9px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 8px; padding-top: 3px;&quot;&gt;
&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot; style=&quot;background-color: white; color: #5c5c5c; list-style-image: initial; list-style-position: initial; list-style-type: decimal-leading-zero; margin-bottom: 1px; margin-left: 45px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li class=&quot;alt&quot; style=&quot;background-color: white; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;vars&quot; style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;$javascript&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;-&amp;gt;link(&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;jquery&#39;&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;,&amp;nbsp;false);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Similarly include your css with the inline option set to false:&lt;div class=&quot;dp-highlighter&quot; style=&quot;background-color: #e7e5dc; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 12px; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 18px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 1px; width: 717px;&quot;&gt;
&lt;div class=&quot;bar&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 45px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;div class=&quot;tools&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; color: silver; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 9px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 8px; padding-top: 3px;&quot;&gt;
&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot; style=&quot;background-color: white; color: #5c5c5c; list-style-image: initial; list-style-position: initial; list-style-type: decimal-leading-zero; margin-bottom: 1px; margin-left: 45px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li class=&quot;alt&quot; style=&quot;background-color: white; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;vars&quot; style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;$html&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;-&amp;gt;css(&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;style&#39;&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;,&amp;nbsp;null,&amp;nbsp;null,&amp;nbsp;false);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Then in your layout file, in the head section, instead of using $scripts_for_layout call the helper:&lt;div class=&quot;dp-highlighter&quot; style=&quot;background-color: #e7e5dc; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 12px; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 18px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 1px; width: 717px;&quot;&gt;
&lt;div class=&quot;bar&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 45px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;div class=&quot;tools&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; color: silver; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 9px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 8px; padding-top: 3px;&quot;&gt;
&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;view plain&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;copy to clipboard&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;print&lt;/a&gt;&lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset#&quot; style=&quot;color: #a0a0a0; font-size: 9px; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot; style=&quot;background-color: white; color: #5c5c5c; list-style-image: initial; list-style-position: initial; list-style-type: decimal-leading-zero; margin-bottom: 1px; margin-left: 45px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li class=&quot;alt&quot; style=&quot;background-color: white; border-left-color: rgb(108, 226, 108); border-left-style: solid; border-left-width: 3px; line-height: 14px; margin-bottom: 5px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;func&quot; style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot; style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;$asset&lt;/span&gt;&lt;span style=&quot;color: black; margin: 0px; padding: 0px;&quot;&gt;-&amp;gt;scripts_for_layout();&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;
&amp;nbsp;9.For More details : &lt;a href=&quot;http://sandbox2.pseudocoder.com/demo/asset&quot;&gt;http://sandbox2.pseudocoder.com/demo/asset&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/4913721948105743932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/how-to-speed-up-big-site-in-cakephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/4913721948105743932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/4913721948105743932'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/how-to-speed-up-big-site-in-cakephp.html' title='How to speed up Big site in cakephp?'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-3702444992415818573</id><published>2012-04-04T23:35:00.003-07:00</published><updated>2012-04-04T23:39:09.732-07:00</updated><title type='text'>Global Constants in CakePHP 2.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;section&quot; id=&quot;core-definition-constants&quot;&gt;
&lt;h2&gt;

&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;Core Definition Constants&lt;/span&gt;&lt;/h2&gt;
Most of the following constants refer to paths in your application.&lt;br /&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;APP&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;APP&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the application’s directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;APP_DIR&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;APP_DIR&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;app&lt;/span&gt;&lt;/tt&gt; or the name of your application directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;APPLIBS&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;APPLIBS&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the application’s Lib directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;CACHE&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;CACHE&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the cache files directory. It can be shared between hosts in a
multi-server setup.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;CAKE&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;CAKE&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the cake directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;CAKE_CORE_INCLUDE_PATH&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;CAKE_CORE_INCLUDE_PATH&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the root lib directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;CORE_PATH&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;CORE_PATH&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the root directory with ending directory slash.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;CSS&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;CSS&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the public CSS directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;CSS_URL&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;CSS_URL&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Web path to the CSS files directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;DS&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;DS&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Short for PHP’s DIRECTORY_SEPARATOR, which is / on Linux and \ on windows.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;FULL_BASE_URL&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;FULL_BASE_URL&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Full url prefix. Such as &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;https://example.com&lt;/span&gt;&lt;/tt&gt;&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;IMAGES&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;IMAGES&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the public images directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;IMAGES_URL&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;IMAGES_URL&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Web path to the public images directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;JS&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;JS&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the public JavaScript directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;JS_URL&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;JS_URL&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Web path to the js files directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;LOGS&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;LOGS&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the logs directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;ROOT&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;ROOT&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the root directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;TESTS&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;TESTS&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the tests directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;TMP&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;TMP&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the temporary files directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;VENDORS&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;VENDORS&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Path to the vendors directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;WEBROOT_DIR&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;WEBROOT_DIR&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;webroot&lt;/span&gt;&lt;/tt&gt; or the name of your webroot directory.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;WWW_ROOT&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;WWW_ROOT&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Full path to the webroot.&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;timing-definition-constants&quot;&gt;
&lt;h2&gt;


&lt;span style=&quot;font-size: x-large;&quot;&gt;Timing Definition Constants&lt;/span&gt;&lt;/h2&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;TIME_START&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;TIME_START&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Unix timestamp in microseconds as a float from when the application started.&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;SECOND&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;SECOND&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals 1&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;MINUTE&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;MINUTE&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals 60&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;HOUR&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;HOUR&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals 3600&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;DAY&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;DAY&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals 86400&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;WEEK&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;WEEK&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals 604800&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;MONTH&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;MONTH&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals 2592000&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;const&quot;&gt;
&lt;dt id=&quot;YEAR&quot;&gt;
&lt;b&gt;&lt;i class=&quot;property&quot;&gt;constant &lt;/i&gt;&lt;tt class=&quot;descname&quot;&gt;YEAR&lt;/tt&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;Equals 31536000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For More Details : http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/3702444992415818573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/global-constants-in-cakephp-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3702444992415818573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3702444992415818573'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/global-constants-in-cakephp-20.html' title='Global Constants in CakePHP 2.0'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-1974701195085646977</id><published>2012-04-04T03:29:00.002-07:00</published><updated>2012-04-04T03:51:39.645-07:00</updated><title type='text'>CakePHP Model Associations Cheat Sheet</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;$hasMany
– one to many&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;UniqueName&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;className&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;thatClassName&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;foreignKey&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;this_fk_id&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;conditions&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;That.field&#39;
=&amp;gt; &#39;somevalue&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;),&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;order&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;That.field DESC&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;limit&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;5&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;That.fields&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;offset&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; 0,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;dependent&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;=&amp;gt;
true,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;exclusive&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; false,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;finderQuery&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;FULL JOIN QUERY&#39;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;);&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;$hasOne
– one to one&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;UniqueName&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;className&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;thatClassName&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;foreignKey&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;this_fk_id&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;conditions&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;That.field&#39;
=&amp;gt; &#39;somevalue&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;),&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; &#39;That.fields&#39;,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Bold;&quot;&gt;dependent&lt;/span&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;
=&amp;gt; true&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;);&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;$belongsTo– many to one&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;UniqueName&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;className&#39;
=&amp;gt; &#39;thatClassName&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;foreignKey&#39;
=&amp;gt; &#39;that_fk_id&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;conditions&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;That.field&#39;
=&amp;gt; &#39;somevalue&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;),&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;fields&#39;
=&amp;gt; &#39;That.fields&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;counterCache&#39;
=&amp;gt; false&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;);&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;$hasAndBelongsToMany– many to many&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;UniqueName&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;className&#39;
=&amp;gt; &#39;thatClassName&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;joinTable&#39;
=&amp;gt; &#39;join(s)_table(s)&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;with&#39;
=&amp;gt; &#39;JoiningClassName&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;foreignKey&#39;
=&amp;gt; &#39;this_id&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;associationForeignKey&#39;=&amp;gt;
&#39;that_id&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;unique&#39;=&amp;gt;
true,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;conditions&#39;
=&amp;gt; array(&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;That.field&#39;
=&amp;gt; &#39;somevalue&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;),&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;order&#39;
=&amp;gt; &#39;That.field DESC&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;limit&#39;
=&amp;gt; &#39;5&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;fields&#39;
=&amp;gt; &#39;That.fields&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;offset&#39;
=&amp;gt; 0,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;finderQuery&#39;
=&amp;gt; &#39;FULL JOIN QUERY&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;deleteQuery&#39;
=&amp;gt; &#39;FULL DELETE QUERY&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&#39;insertQuery&#39;
=&amp;gt; &#39;FULL INSERT QUERY&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;);&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Courier10PitchBT-Roman;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;i&gt;&lt;b&gt;Model Relationship Convertions&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial-BoldItalicMT,cursive;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Foreign
keys in hasMany, belongsTo or hasOne relationships&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;are
recognized by default as the (singular) name of the related&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;model
followed by _id&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Join
tables, used in hasAndBelongsToMany (HABTM)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;relationships
between models should be named after the model&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;tables
they will join in alphabetical order (apples_zebras rather&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;than
zebras_apples).&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;All
tables with models require a PRIMARY KEY named &#39;id&#39;.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;LEFT&quot; style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/1974701195085646977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/cakephp-model-associations-cheat-sheet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/1974701195085646977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/1974701195085646977'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/04/cakephp-model-associations-cheat-sheet.html' title='CakePHP Model Associations Cheat Sheet'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-3434912035367934296</id><published>2012-03-30T05:27:00.001-07:00</published><updated>2012-03-30T05:27:58.887-07:00</updated><title type='text'>Differences between bind model and contain cakephp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-family: &#39;Trebuchet MS&#39;, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin-bottom: 7px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
What is the differences between bind model and contain cakephp?&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border-width: 0px; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
One of the most powerful features of CakePHP is the ability to link relational mapping provided by the model. In CakePHP, the links between models are handled through associations. If you set up these associations in your model, then when you retrieve your data Cake will automagically retrieve associated data too.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
&lt;b&gt;The containable behavior allows you to filter and limit model find operations (assuming you have set up your model associations)&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
&lt;a href=&quot;http://book.cakephp.org/view/1323/Containable&quot; rel=&quot;nofollow&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #4a6b82; cursor: pointer; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;http://book.cakephp.org/view/1323/Containable&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
&lt;b&gt;bind and unbind are useful for changing model associations on the fly:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
&lt;a href=&quot;http://book.cakephp.org/view/1045/Creating-and-Destroying-Associations-on-the-Fly&quot; rel=&quot;nofollow&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #4a6b82; cursor: pointer; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;http://book.cakephp.org/view/1045/Creating-and-Destroying-Associations-on-the-Fly&lt;/a&gt;&lt;/div&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border-width: 0px; color: black; font-family: &#39;Trebuchet MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.3; margin: 0px 0px 7px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/3434912035367934296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/03/differences-between-bind-model-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3434912035367934296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/3434912035367934296'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/03/differences-between-bind-model-and.html' title='Differences between bind model and contain cakephp'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-5450105705665483183</id><published>2012-03-28T23:52:00.003-07:00</published><updated>2012-04-06T21:30:45.116-07:00</updated><title type='text'>htaccess in cakephp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;




&lt;span style=&quot;color: #783f04;&quot;&gt;BASIC KNOWLEDGE OF&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;.htaccess&lt;/span&gt; &lt;span style=&quot;color: #783f04;&quot;&gt;IN CAKEPHP&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;



&amp;nbsp;&lt;/h3&gt;
&lt;h3 style=&quot;color: #b45f06; text-align: left;&quot;&gt;



What is .htaccess?&lt;/h3&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
.htaccess&lt;span style=&quot;background-color: #ffffe3; color: black; display: inline ! important; float: none; font-family: &#39;Lucida Sans Unicode&#39;,Tahoma,Arial,sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;(Hypertext Access file)&lt;/span&gt; is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn &#39;loaded via the Apache Web Server&#39;, then the .htaccess file is detected and executed by the Apache Web Server software. These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. These facilities include basic redirect functionality, for instance if a 404 file not found error occurs, or for more advanced functions such as content password protection or image hot link prevention.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;color: #b45f06; text-align: left;&quot;&gt;




Use of&amp;nbsp; .htaccess?&lt;/h3&gt;
&lt;h4 style=&quot;color: #e69138; text-align: left;&quot;&gt;




Forbidding access:&lt;/h4&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Forbidding all files&lt;/li&gt;
&lt;li&gt;Allow access from a certain IP address&lt;/li&gt;
&lt;li&gt;Forbid access from a certain IP address&lt;/li&gt;
&lt;li&gt;Forbidding a group of files by mask&lt;/li&gt;
&lt;li&gt;Forbidding a particular file&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;




&lt;/h3&gt;
&lt;h4 style=&quot;color: #e69138; text-align: left;&quot;&gt;




Setting a password:&lt;/h4&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Password for a directory&lt;/li&gt;
&lt;li&gt;Password for one file only&lt;/li&gt;
&lt;li&gt;Password for a group of files&lt;/li&gt;
&lt;li&gt;Checking access rights to three directories two of which are subdirectories&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;




&lt;/h3&gt;
&lt;h4 style=&quot;color: #e69138; text-align: left;&quot;&gt;




Redirections:&lt;/h4&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Redirecting a visitor to another URL&lt;/li&gt;
&lt;li&gt;Displaying different pages depending on the visitor&#39;s IP address&lt;/li&gt;
&lt;li&gt;Redirecting a user when he requests certain pages&lt;/li&gt;
&lt;li&gt;How to change the default page&lt;/li&gt;
&lt;li&gt;How to make Apache process SSI directives&lt;/li&gt;
&lt;li&gt;How to process Apache errors yourself?&lt;/li&gt;
&lt;li&gt;How to forbid the contents of a directory to be displayed if it has no index file?&lt;/li&gt;
&lt;li&gt;Is it possible to specify the default encoding of files the browser receives them in?&lt;/li&gt;
&lt;li&gt;Is it possible to specify the encoding of uploaded files?&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;




&lt;/h3&gt;
&lt;h4 style=&quot;color: #e69138; text-align: left;&quot;&gt;




Frequent errors:&lt;/h4&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;I created the .htaccess file, but the server returns 500 - Internal Erorr&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;




&amp;nbsp;&lt;/h3&gt;
&lt;h3 style=&quot;color: #b45f06; text-align: left;&quot;&gt;




How to configure .htaccess in cakephp?&lt;/h3&gt;
&lt;h3 style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;




&lt;/h3&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
/var/www/app/webroot/.htaccess&lt;br /&gt;
&lt;br /&gt;
&lt;ifmodule mod_rewrite.c=&quot;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteEngine On&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteCond %{REQUEST_FILENAME} !-d&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]&lt;/ifmodule&gt;&lt;br /&gt;
/var/www/app/.htaccess&lt;br /&gt;
&lt;br /&gt;
&lt;ifmodule mod_rewrite.c=&quot;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteEngine on&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteRule&amp;nbsp;&amp;nbsp;&amp;nbsp; ^$&amp;nbsp;&amp;nbsp;&amp;nbsp; webroot/&amp;nbsp;&amp;nbsp;&amp;nbsp; [L]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteRule&amp;nbsp;&amp;nbsp;&amp;nbsp; (.*) webroot/$1&amp;nbsp;&amp;nbsp;&amp;nbsp; [L]&lt;/ifmodule&gt;&lt;br /&gt;
/var/www/.htaccess&lt;br /&gt;
&lt;br /&gt;
&lt;ifmodule mod_rewrite.c=&quot;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteEngine on&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteRule ^$ app/webroot/ [L]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RewriteRule (.*) app/webroot/$1 [L]&lt;/ifmodule&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/5450105705665483183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/03/basic-knowledge-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/5450105705665483183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/5450105705665483183'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/03/basic-knowledge-of.html' title='htaccess in cakephp'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1303777562440464932.post-737990764799179631</id><published>2012-03-28T04:20:00.001-07:00</published><updated>2012-04-06T21:31:17.546-07:00</updated><title type='text'>New Features cakephp2.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 style=&quot;color: #ea9999; text-align: left;&quot;&gt;




&lt;u&gt;New Features in CakePHP 2.0&lt;/u&gt;&lt;/h1&gt;
&lt;h2&gt;




Models&lt;/h2&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The model construction process has been made lighter. Model associations are
now lazy loaded, applications with lots of models and associations will see
great time reductions in the bootstrap process.&lt;/div&gt;
Now models won’t require a database connection in the construction process.
The database will be accessed for the first time only when a find operation is
issued or information for one of the columns is required.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;




View&lt;/h2&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
View will now always have the last rendered content (view or layout) accessible
through &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;$this-&amp;gt;output&lt;/span&gt;&lt;/tt&gt;. In helpers you can use &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;$this-&amp;gt;_View-&amp;gt;output&lt;/span&gt;&lt;/tt&gt;. Modifying
this property will change the content that comes out of the view rendering. &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;


Helpers&lt;/h2&gt;
&lt;h5 style=&quot;text-align: left;&quot;&gt;


HtmlHelper :&lt;/h5&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;getCrumbList()&lt;/span&gt;&lt;/tt&gt; Creates breadcrumb links wrapped in &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt; elements&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;loadConfig()&lt;/span&gt;&lt;/tt&gt; has moved from &lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/views/helpers.html#Helper&quot; title=&quot;Helper&quot;&gt;&lt;tt class=&quot;xref php php-class docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;Helper&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt; to &lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper&quot; title=&quot;HtmlHelper&quot;&gt;&lt;tt class=&quot;xref php php-class docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;HtmlHelper&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;
class. This method now uses the new reader classes (see 2.0 &lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/development/configuration.html#Configure&quot; title=&quot;Configure&quot;&gt;&lt;tt class=&quot;xref php php-class docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;Configure&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt;)
to load your config file. As an option you can pass the path as second parameter
(&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;app/Config&lt;/span&gt;&lt;/tt&gt; is default). To simplify, you can set the configuration file
(and the reader) in &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;Controller::$helpers&lt;/span&gt;&lt;/tt&gt; (example below) to load on helper
constructor. In configuration file you can set the below keys:&lt;/li&gt;
&lt;li&gt;&lt;blockquote&gt;
&lt;div&gt;
&lt;ul class=&quot;simple&quot;&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;tags&lt;/span&gt;&lt;/tt&gt; Should be an array with key value;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;minimizedAttributes&lt;/span&gt;&lt;/tt&gt; Should be a list;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;docTypes&lt;/span&gt;&lt;/tt&gt; Should be an array with key value;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;attributeFormat&lt;/span&gt;&lt;/tt&gt; Should be a string;&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;minimizedAttributeFormat&lt;/span&gt;&lt;/tt&gt; Should be a string.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&amp;nbsp;Example of how to set configuration file on controller: &lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #ead1dc; color: #660000;&quot;&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$helpers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;&#39;Html&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;&#39;configFile&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;config_file&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;php&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #ead1dc; color: #660000;&quot;&gt;&lt;span class=&quot;c1&quot;&gt;     // Option one: an array with filename and reader name&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;&#39;configFile&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;config_file&#39;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #ead1dc; color: #660000;&quot;&gt;&lt;span class=&quot;c1&quot;&gt;     // Option two: a string with filename.&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #ead1dc; color: #660000;&quot;&gt;&lt;span class=&quot;c1&quot;&gt;&amp;nbsp;&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;
&lt;h5 style=&quot;text-align: left;&quot;&gt;


FormHelper : &lt;/h5&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;




&lt;/h4&gt;
&lt;ul class=&quot;simple&quot;&gt;
&lt;li&gt;&lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper&quot; title=&quot;FormHelper&quot;&gt;&lt;tt class=&quot;xref php php-class docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;FormHelper&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt; now supports all HTML5 input types and custom input
types. Just use the input type you want as the method on the helper. For
example &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;range()&lt;/span&gt;&lt;/tt&gt; would create an input with type = range.&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;postLink()&lt;/span&gt;&lt;/tt&gt; and &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;postButton()&lt;/span&gt;&lt;/tt&gt; Creates link/button to
access some page using HTTP method POST. With this, in your controller you can
avoid some action, like delete, to be accessed by GET method.&lt;/li&gt;
&lt;li&gt;&lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;select()&lt;/span&gt;&lt;/tt&gt; with multiple = checkbox, now treats the &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;&#39;id&#39;&lt;/span&gt;&lt;/tt&gt;
attribute as a prefix for all the generated options.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;




Router&lt;/h3&gt;
Route objects can now return full urls, and &lt;a class=&quot;reference internal&quot; href=&quot;http://book.cakephp.org/2.0/en/development/routing.html#Router&quot; title=&quot;Router&quot;&gt;&lt;tt class=&quot;xref php php-class docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;Router&lt;/span&gt;&lt;/tt&gt;&lt;/a&gt; will not further
modify them beyond adding the query string and fragment elements. For example
this could be used to create routes to handle subdomains, or enabling https/http
flags. An example of a route class that supports subdomains would be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;highlight-php&quot;&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;pre style=&quot;background-color: #ead1dc;&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt; ? php&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SubdomainRoute&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;CakeRoute&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

 &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nv&quot;&gt;$subdomain&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;subdomain&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;subdomain&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #ead1dc;&quot;&gt;&lt;span class=&quot;nb&quot;&gt;        unset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;subdomain&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$subdomain&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;http://&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$subdomain&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;.localhost&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
When creating links you could do the following to make links pointing at other
subdomains.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&amp;nbsp;&lt;span class=&quot;cp&quot;&gt;&amp;lt; ? php&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: #ead1dc;&quot;&gt;
&lt;span class=&quot;k&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Html&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;link&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;&#39;Other domain&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;subdomain&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;test&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;controller&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;posts&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;action&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;add&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;highlight-php&quot;&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;pre&gt;&amp;nbsp; &lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
The above would create a link with &lt;a class=&quot;reference external&quot; href=&quot;http://test.localhost/posts/add&quot;&gt;http://test.localhost/posts/add&lt;/a&gt; as the url.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks to : http://book.cakephp.org/2.0/en/appendices/new-features-in-cakephp-2-0.html &lt;br /&gt;
&lt;h3&gt;




&amp;nbsp;&lt;/h3&gt;
&lt;br /&gt;
&lt;h3&gt;




&amp;nbsp;&lt;/h3&gt;
&lt;br /&gt;
&lt;h2&gt;




&amp;nbsp;&lt;/h2&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chetan4cake.blogspot.com/feeds/737990764799179631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chetan4cake.blogspot.com/2012/03/new-features-in-cakephp-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/737990764799179631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1303777562440464932/posts/default/737990764799179631'/><link rel='alternate' type='text/html' href='http://chetan4cake.blogspot.com/2012/03/new-features-in-cakephp-2.html' title='New Features cakephp2.0'/><author><name>Chetan Patel</name><uri>http://www.blogger.com/profile/07338242523420263985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>