This has always been a touchy subject, especially in larger computer firms. But first, let me tell you how I got into Open Source. I started coding in Turbo Pascal 7.0, in about 1996 when I was in Grammar School. I took Turbo Pascal more as an introduction to Programming, instead of a product to do something constructive in.
After Pascal, I was looking into something visual. Hence, I fell into Visual Basic 5.0. Yeah, I know, I'm sorry.
Now this was my first step towards the open source community. I must admit, that I downloaded a pirated copy and ran with it for a while. Now, that was all well and good when I was sitting home playing around with stuff. But when it came to actually, to producing something for a market, you can't (or should I say, shouldn't) do that with pirated software.
After that, I got into web development. For this, there was a plethora of free tools available, for use. So I did that for a while. When I got back to college, I got into C++ (using Visual Studio, but still essentially free). That was a step in the right direction. However, as the semesters went on, we got more into using the .NET library. However, for my web development I never got into ASP.
The First Real Plunge into Open Source - Enter PHP
Bit by bit, web development gave way to web programming. This is where PHP came in. I got more familiar with PHP when I started working on different projects for clients. I chose PHP for a few main reasons:
- Free Documentation: I could learn almost everything I needed through online documentation.
- Cost: My first problem was hosting. ASP hosts used to be almost twice as expensive as their Linux counterparts.
The Open Source Misconception
One of the problems that people have with Open Source is that they think that it's unsupported. People seem to think that open source software is written by a bunch of kids in basements or something. This is not the case, by any means. For example, a lot of the Linux distributions are totally free and totally supported. Wake up people; free doesn't mean unsupported. The whole “You get what you pay for” isn't always true.
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.