Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Except for all the stuff noted by deizel (great post btw), remember one of the basic cake principles: <strong>fat models, skinny controllers</strong>. You can check <a href="http://www.littlehart.net/atthekeyboard/2007/04/27/fat-models-skinny-controllers/" rel="nofollow noreferrer">this example</a>, but the basic idea is to put all your data-mangling stuff in your models. Your controller should (mostly) be just a link between your models and views. Your PremiumSitesController::index() is a perfect example of something that should be somewhere in your model (as pointed out by deizel).</p> <p><a href="http://www.littlehart.net/atthekeyboard/" rel="nofollow noreferrer">Chris Hartjes</a> has also written a <a href="http://littlehart.net/book/" rel="nofollow noreferrer">book about refactoring</a>, you might want to take a look at it if you really want to learn (it's not free, but it's cheap though). Also, <a href="http://www.pseudocoder.com/" rel="nofollow noreferrer">Matt Curry</a> has one, with a cool name: <a href="http://www.pseudocoder.com/free-cakephp-book/" rel="nofollow noreferrer">Super Awesome Advanced CakePHP Tips</a>, and it's completely free for download. Both make for a good read.</p> <p>I'd also like to plug my own article about cake which I like to believe is important for code quality in cake: <a href="http://lecterror.com/articles/view/code-formatting-and-readability" rel="nofollow noreferrer">Code formatting and readability</a>. Though I understand if people disagree.. :-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload