News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Graham Bird's Blog:
Extra-pretty URLs with slugs
June 21, 2006 @ 12:45:35

As the CakePHP framework grows in popularity, more and more tutorials are show up for it, including this quick and handy one from Graham Bird. In it, he explains the use of "slugs" instead of IDs to make URLs simpler to use and remember.

In this tutorial you will learn how to use words rather than IDs in your Cake URLs. These words are known as "slugs" in Wordpress so I decided to call them slugs too.

Cake's normal URLs look like this: www.example.com/stories/read/123245221
and we are going to make them look like this: www.example.com/stories/read/sleepingbeauty

Thanks to the simplicity of the framework, the tutorial is pretty short, using one of CakePHP's "magic functions" to help cross-match the slug given with a table in the database with a slug/title relationship. There's not much code to it and he provides a demo

0 comments voice your opinion now!
cakephp tutorial slugs id simple database cakephp tutorial slugs id simple database


blog comments powered by Disqus

Similar Posts

PHPMaster.com: Explore Aspect Oriented Programming with CodeIgniter, Part 2

Vid Luther's Blog: Talking to multiple databases with Symfony 1.2

AnyExample.com: Making XML/XSLT driven site using PHP

Community News: CakePHP Project Launches "The Show" (Live/Podcast Series)

Okaka Design Blog: Event calendar using Codeigniter and jQuery without BackendPro


Community Events





Don't see your event here?
Let us know!


configure unittest bugfix library wordpress interview api introduction release language install laravel list podcast application code developer threedevsandamaybe series community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework