CakePHP
The CakePHP Bakery Is Out Of Yeast
CakePHP vs. Ruby On Rails – A Very Bias Look at Why I Choose CakePHP
First of let me state that this post is very bias towards CakePHP. Truth be told, I haven’t even installed or used Ruby on Rails. The closest I’ve come is looking at various code snippets I’ve found around. With that said, you may want to stop reading now.
These arguments are not based on hard facts, since I haven’t done much research on the matter. A lot of them come from a post at Clickable Bliss discussing the PHP vs. Ruby On Rails Issue.
-
Steep Learning Curve - Laziness
One thing I really hate is learning stuff. It is especially bothersome when you're trying to crank out a project or web application in a limited amount of time.
With CakePHP I'm required to learn about the **MVC style of development** as well as CakePHP **conventions**.
With Ruby on Rails, I would have to learn MVC, Ruby on Rails conventions and I would have to s**tart from scratch with the Ruby programming language** as well.
Cute CakePHP Trick of the Day – GenerateList Empty Slot In List
Give Me 15 Minutes and I’ll Make You A jQuery Expert
The Secret of CakePHP Advanced Routing – Even Better URLs
The power of CakePHP has a lot to do with conventions. The framework (like many others) harnesses its power by enforcing certain conventions and standards that users must follow. You name your database tables, file names, etc; a particular way and boom, models, views and controllers are automatically created and ready for use. This is the beauty of the MVC structure. Your URLs also follow thing structure: www.site.com/controller/action/params.
Straying From Convention
But sometimes, conventions suck. Sometimes you want greater control over things, but still don’t wanna do them from scratch. The strictness of the MVC structure dictates how your URLs will look. Consider this: CakePHP has a basic pages controller, which you can use when you don’t need a model or controller. You just enter the view and voila , a page. But your pages have a URL of:
Wouldn’t you rather:
The Routes Configuration examples in the CakePHP manual are a bit simple. Here’s how to use a bit more advanced routing:
Router::connect('/(.*).htm', array('controller' => 'pages', 'action' => 'display'));
This says, consider everything that comes in with an HTM extension and send the URL as a parameter to the display action on the pages controller.
The idea was stolen from Lumad CMS. They use the following in Rewrite in .htaccess for their pages:
RewriteRule ^~(.*) content_pages/displayurl/$1 [L]
They use a prefix of ‘~’ instead of a suffix of ‘.htm’, but you get the picture. I’m sorry to disappoint you, I’m not as creative as you thought.