Unless you've been living under a rock for the past couple of years, you may have heard about Ruby on Rails. It's the latest greatest web development platform that has become immensely popular due to its use of convention over configuration (resulting in exceptionally clean code). Cake is the PHP equivalent of Ruby on Rails. It's ideal for someone who wants to utilize the MVC design pattern but doesn't necessarily have the time to learn Ruby. Avatar Financial is one of our oldest clients, and when I was tasked with re-designing and rebuilding their site I figured it would be an opportune time to switch to CakePHP away from the home-brew framework I used on SEOmoz and many other sites.
CakePHP is very new, so the documentation is a bit sparse in areas, particularly when you get past the basics. While developing the site I took a lot of notes and decided to create a list to share with others, so without further ado:
Rebuilding Avatar Financial in CakePHP
Design
The author's views are entirely his or her own (excluding the unlikely event of hypnosis) and may not always reflect the views of Moz.
Bravo Oatmeal,
We have been developing in Cakephp for about 8 months now.
The more press they get the better!
A simple (pair of) question I hope you could answer - how much time/resources did you win by switching to cakePHP instead of using moz-framework? And how much time/resources do you think the switch will save in future projects? 10%, 20% or more?
A developer in me valueslearning new techniques very highly, but the enterpreneur in me says the value is in used time/resources. If a technique can't provide a clear cut, then it is not worth the shot. I've tried several mvc-frameworks, and I hate to say most of them are overkill and waste of time if you have a self-made, well documented, solid function library to work with.
It's hard to say for certain, but I estimate it probably cut my time by 20%. Since it was my first CakePHP site I was learning the whole time, so it slowed me down a bit in the beginning. Nearing the end of the development, however, I was flying.
The next site I build with cake will go a lot faster now that I'm up to speed with how it all works.
The area that it saved me the most time was probably forms validation and all the simple CRUD (create/read/update/delete) functionality. Not having to write endless forms for inserting/updating data really was a lifesaver.
I'd like to add that it also helps with injection/XSS protection and helps maintain an easy to read code base -- which is invaluable for maintannce.
I agree, even if it took a bit more time up front it'll save me a ton of time in the future because the code is super clean
I been learning cake for about the last couple of weeks and it seems like a good MVC framework other frameworks I looked at were symfony and also codeigniter both I like but symfony is a bit harder to install on a remote host, code igniter is not realy mature enough yet but is more of a lightweight framework but the docs are much better that cake.
cool stuff, I'll check them out
Hmmm, what does an article about Cake has to do with a Loan company's website...Oh, wait, I forgot: is that linkbait??
high fives to captain obvious!
From the placement of the list on their site it looks like you were also tasked with some quick link building.
SubDirectories...
Is the placement of sub-pages in a /pages/folder/ a formation by cakePHP or just a choice in order?
You can use whatever subdirectory you want, the "/pages" folder is just the result of using the static pages controller. When you use CakePHP you end up with very clean, pretty URLS, such as:
/apply (loan application form) /posts/ (list of blog entries) /posts/view/391/on_the_horizon (individual blog entry) /articles (list of articles)