These posts will only confuse the man!
georgerobbo: Doing this is very similar to working with ID’s. Normally you create a database record then use the ID number in the URL to fetch the content. Using a slug is exactly the same, but ofc first it needs to be made.
$this->db->set('slug', url_title($this->input->post('title')));
$this->db->set('title', $this->input->post('title'));
$this->db->insert('articles');
That will set it for your INSERT column, but is only one of many ways to achieve this. Pick your preferred syntax.
Then when you want to view an article, just do this:
<?php
class Blog extends Controller {
function view_article($slug)
{
$this->db->where('slug', $slug);
$this->db->get();
}
}
?>
Again a rather rough demo, that ofc should be in a model, but blog/view_article/some-title will now work fine. Shorten that with some routes and you are away!