• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String as an URL

I'm really sorry but I'm still not quite understanding how to do it.

Say my database structure is as the following.

Primary_ID Title Description Thumbnail Content
1 example learning php php.jpg we're going to learn how to use php

I then have the model stalker.php autoloaded, using the function get_article.

function get_article()
        $this->db->set('slug', url_title($this->input->post('Title')));
        $this->db->set('title', $this->input->post('Title'));

And then I have my controller named Article.

function index($slug)
        $data['title'] = 'Article';
        $this->db->where('stalker', $slug);
        $this->load->view('meta', $data);
        $this->load->view('content', $data);
        $this->load->view('index', $data);

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.