Now that our site is up and operational, it is a good time to turn cake into production mode, live mode, launch mode. Open up your core.php file and change the line:
41 | Configure::write('debug', 2); |
To:
41 | Configure::write('debug', 0); |
This in effect turns debugging off, which includes the database debugging tool at the baseline of the site. So you should now have no scrollbars! And be looking at something like:
Awesome work! I’d just like to reflect here for a bit on this tutorial. This tutorial by no means is exhaustive of all of the features with CakePHP. The conventions I used in this tutorial may also be regarded as not effective or correct. I did however write this tutorial to teach you, perhaps someone new to CakePHP, all the tools I could fit in this tutorial that you might wish to know later on.
For example you could of included some display logic to simply use the index.ctp file for your view, just test if the shorturl was present. Or you could of stuck to conventions as to database table names with CakePHP. I shook things up a bit here so you could see both the conventional way, and the way to get around conventions shall you need to! Alot of my database functions could be combined into a single function, however I opted to split this up to report back more fragmented data, as apposed to returning a full array of the url.
I hope this tutorial has taught you most of all how to get things done quickly with CakePHP, and the potential power of generating applications with CakePHP! If you had any problems, issues or qualms with this tutorial please write in the comment box below! I’ll get back to you! Also this tutorial took a hell of a long time to write, as I tried to elaborate on what was going on to the best of my ability. If you feel like donating to my paypal account, voidet [:at:] nightgen.com to buy me a coffee or a beer that would be greatly appreciated! Also if you are going to use this script/design anywhere else you must have explicit written consent from myself!






2 trackbacks/pingbacks
Comments About CakePHP URL Shortener Service Tutorial
// 3 comments so far.
Elizabeth Gibbons // August 26th 2009
i have never seen such a comprehensive tutortial on this , good on yah, i’ll buy you a paypal beer any day
hendrik // August 31st 2009
great work, thank you!
JP // December 16th 2009
Awesome tutorial man! Thanks allot
You can follow any responses to this entry via its RSS comments feed. You may also leave a trackback by clicking this link.