Using slugs in codeigniter

Viewed 52302

I have heard of people using slugs for generating clean urls. I have no idea how it works. Currently i have a codeigniter site which generates url's like this

www.site.com/index.php/blog/view/7

From what i understand by maintaining a slug field it is possible to achieve urls like

www.site.com/index.php/blog/view/once-upon-a-time

How is this done? Especially in reference to codeigniter?

2 Answers

To my ES friends, remove accented characters using this, from Text Helper:

    $string = 'áéíóú ÁÉÍÓÚ';    
    $slug = url_title(convert_accented_characters($string), 'dash', true));
    echo $slug; //aeiou-AEIOU
Related