Published: Tuesday, November 6th, 2007

Today I popped onto the CakePHP Bakery looking for the obAuth Component. To my surprise, I got a blank page.
Seems like there’s a database issue. Here’s hoping that it’s not down for too long.
Update (11/20/07):
Most of the stuff is back up on the bakery. The rating is still a small issue, but all the code and tutorials are up and running.
Bake On!
Popularity: 19%
Share This
Published: Monday, November 5th, 2007
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 start from scratch with the Ruby programming language as well.
Popularity: 44%
Share This
Published: Thursday, November 1st, 2007

With this post I'm introducing a new segment to this blog: Cute CakePHP Trick of the Day.
This is basically going to be a learn as I learn sort of thing. There are always a bunch of little things that I want to do in CakePHP, but just haven't figured out. So every time I stumble onto something, I'll let you guys in on it.
I love the GenerateList() function. This is generally used when you have models with associations with other models. The GenerateList function is often used in these cases to populate a drop down list or a multiple select list. A typical example is a state drop down on an address form.
One problem that I have with this implementation is that it always produces a complete list and there is no empty slot. There is nothing to say that I don't want to associate anything for this entry. On a drop down list, it's impossible not to select an element. On a multiple selection list, even if the user holds CTRL and clicks to unselect the current entry, CakePHP ignores this entry.
Here's the fix. Assuming in your controller you have something like:
Share This
Published: Tuesday, September 18th, 2007
Introduction
In the spirit of rapid web development, I've stumbled upon jQuery. Here's a testimonial from a jQuery user:
You start with 10 lines of jQuery that would have been 20 lines of tedious DOM JavaScript. By the time you are done it's down to two or three lines and it couldn't get any shorter unless it read your mind."
In my experience it's been more like five (5) lines of jQuery.
jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.
I've found jQuery great for the following reasons:
- Simple Ajax in a breeze
- Search for elements in the DOM is made easy
- The helper function [ $() ] is a pleasure to use
- Most importantly: it handles cross browser compatibility.
Here We Go - Tutorials Galore
Your first step will be to Download jQuery 1.2.1 and include it in the head of your web page. After this you need to start reading some tutorials. Don't worry, it's going to take 15 minutes tops for you to start writing usable code:
Share This
Published: Thursday, September 6th, 2007
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 voilà , a page. But your pages have a URL of:
www.site.com/pages/page
Wouldn't you rather:
www.site.com/page.htm
The Routes Configuration examples in the CakePHP manual are a bit simple. Here's how to use a bit more advanced routing:
PHP:
-
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.
Popularity: 23%
Share This
Published: Wednesday, August 29th, 2007
To develop PHP and MySQL on a Windows machine, I usually use WAMP. I had tried XAMPP before, but I found that it was a bit bloated, with the OpenSSL and FTP Server, etc. So WAMP it was. But lately, I decided to give XAMPP another try and I like what I've got so far.
For the past three weekends, I've been away from my personal computer. The only life line I've had is my stock of Portable Apps on my 512MB USB disk. So I've been neglecting a few projects lately. But all of this has changed as of Friday. I've discovered XAMPP Lite. It's just what it says it is, a Lite version of XAMPP. The beauty of this is that it can also run from a USB disk. There's no install required. So partnered with XAMPP Lite, Mozilla Firefox, Portable Edition, NotePad++ Portable, and, FileZilla Portable I can take my development on the road to anywhere I can stick in my USB disk.
Share This
Published: Monday, August 27th, 2007
Introduction
As you guys know, I've recently discovered the marvels of rapid web development with CakePHP. This shall be the first in a long serious of CakePHP related material coming from me since I've now veered off on a slightly different focus.
After a short analysis, I've picked CakePHP as my framework of choice. I've been struggling through it for a few months now, but it's by far better than the alternative of coding by hand (Yeah, I know I'm lazy). I've struggled through it so that you don't have to.
Downloading - Stable or Alpha Version
Step one is downloading CakePHP. The first problem that you'll run into is that there are two (2) versions to pick from: Stable 1.1 and Alpha 1.2. When I first started out, I needed to use CakePHP for a project instantly, so I decided to with the stable version because the word alpha scared me a little bit. I mean, it's not even beta yet.
Share This
Published: Wednesday, August 22nd, 2007
New Domain
I has finally occurred to me that I should have gotten my own domain name a long time ago. Really, I don't know what I was waiting for, but it was about time. Since my focus is Web 2.0, WebDevelopment2.com was an obvious choice. I've already written about moving wordpress to a different domain, so moving to this domain was walk in the park. I loaded up PhpMyAdmin and exported my database. Pulled up Notepad++ and did a search and replace for my old URL to the new one. Saved the file, zipped it back up, and uploaded it to the server. Since I usually deal with large databases, I didn't even bother trying to load into PhpMyAdmin. Bigdump is now my favorite database importer for MySQL.
Finally, I loaded up the .htaccess file on the old domain name and slapped in a RewriteRule with a 301 redirect to WebDevelopment2.com. And Viola, here we have Wordpress blog perfectly redirected, without losing a single inbound link. Sure, the Page Rank on the domain name is 0 (for now), but with a name like Web Development, it won't be for long.
Share This