title: Why use Slug in Codeigniter?
body: <p>i have that code. i don't get why they use slug. can someone explane?
  i search what is the mean of slug. I think It is like a variable, I can chance it's name. but what is the importance of slug?
  yazi_model.php model-></p>
  
  <pre><code>&lt;?php
      class Yazi_model extends CI_Model{
          public function __construct(){
              $this-&gt;load-&gt;database();
          }
  
          public function getir_yazilar($slug = FALSE){ //why slug should be false? why we use slug for it?
              if($slug === FALSE){ //is this 'if' is necessary? I can just write last code and it will work.
                  $query = $this-&gt;db-&gt;get('yazilar'); 
                  return $query-&gt;result_array(); 
              }
              $query = $this-&gt;db-&gt;get_where('yazilar',array('slug' =&gt; $slug));//why slug?
              return $query-&gt;row_array();
      }
  }
  </code></pre>
  
  <p>Yazilar.php controller-></p>
  
  <pre><code>&lt;?php
      class Yazilar extends CI_Controller{ 
          public function index(){ //why not use slug
              $veri['baslik'] = 'Son yazılar';
              $veri['yazilar'] = $this-&gt;yazi_model-&gt;getir_yazilar();
              $this-&gt;load-&gt;view('tema/header');
              $this-&gt;load-&gt;view('yazilar/index',$veri);
              $this-&gt;load-&gt;view('tema/footer');
          }
  
          public function detay($slug = NULL){ //why slug
              $veri['yazi'] = $this-&gt;yazi_model-&gt;getir_yazilar($slug); //why slug
              if(empty($veri['yazi'])){
                  show_404();
              }
  
              $veri['baslik'] = $veri['yazi']['baslik'];
              $this-&gt;load-&gt;view('tema/header');
              $this-&gt;load-&gt;view('yazilar/detay',$veri);
              $this-&gt;load-&gt;view('tema/footer');
          }
      }
  </code></pre>