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:
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.
Posted in CakePHP, PHP, SEO.
By Kevin Lloyd
– September 6, 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.
Posted in CakePHP, MySQL, PHP.
By Kevin Lloyd
– August 29, 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.
Posted in CakePHP, MySQL, PHP.
By Kevin Lloyd
– August 27, 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.
Posted in Blog, CakePHP, JavaScript, MySQL, PHP.
By Kevin Lloyd
– August 22, 2007
Posted in Blog.
By Kevin Lloyd
– August 4, 2007
After reading this post, I have come to the conclusion that Web Developers can learn a lot from this.
I cannot over stress the importance of number seven (7) and eight (8):
- Everyone suggests researching webhosting companies, but for your first year, just use a web host that can get the job done. I use Dreamhost, and it’s fine except for the 20,000+ visit days …
- If you’re serious about your site, get your own domain name that somewhat relates to your topic (obviously cleverdude.com doesn’t relate to finances). Jim recommends GoDaddy.com, but …
A good domain name is essential to any website. Take your time when picking one. The same goes for a host. I would definitely go with reviews for this. Resist the urge to go with advertising or price solely. I made that mistake and I’m currently riding out my contract so, hopefully, I’ll be able to move with little problems. Just because a web host is advertised in your favorite magazine doesn’t mean that it’s the better deal.
If you’re a blogger, this is a definite read. If you’re a web designer, scan through the list and extract those that apply.
Source: 50 Tips for New Personal Finance Bloggers [Clear Dude]
Posted in Blog.
By Kevin Lloyd
– July 21, 2007

OK, now this is really cool. If you ask me it’s a beautiful use of AJAX.
- Pick a category
- Search
- Click on an item and get a pop up with details
- Click and Drag items to the shopping cart on the right

Yep, that’s it. The name fits great. There is absolutely none of the clutter that you get from Amazon’s main website.
This site deserves a lot more than what it’s getting right now.
Source: Search Amazon In Style [uncluttr]
Posted in Ajax, Money.
By Kevin Lloyd
– July 16, 2007
Now, I’m going to be deliberately vague because I don’t to give this blogger any traffic.
This is what happened. I developed a new a interest lately. As a result, I was looking for a blog that I could use as a reference. All my searches returned this one blog. The name of the blog was specific to the actual topic. I went on the blog and to my dismay, I saw post after post which looked like emails from a mailing list. The funniest thing is that the Google Groups mailing list from which he was sponging his information was one that I had recently subscribed to. I actually found a pos, which was me asking a question to the group.
This is what I assume he did. He went into the Blogger configuration and set up the Blog by Email option. And he used the same email address that he used to sign up to the group. So, every time a message is sent to the group it is forwarded to his email address and ends up on his blog.
Posted in Blog, General.
By Kevin Lloyd
– July 12, 2007
Recent Comments