title: Returning info to controller from model in codeigniter
body: <p>I've got this model function:</p>
  
  <pre><code>        public function set_news()
          {
              $this-&gt;load-&gt;helper('url');
  
              $slug = url_title($this-&gt;input-&gt;post('title'), 'dash', TRUE);
  
              $data = array(
                  'title' =&gt; $this-&gt;input-&gt;post('title'),
                  'slug' =&gt; $slug,
                  'text' =&gt; $this-&gt;input-&gt;post('text')
              );
  
              return $this-&gt;db-&gt;insert('news', $data);
          }
  </code></pre>
  
  <p>Where, as you can see, there is a variable called <code>$slug</code>. 
  The way I call this function is through a controller:</p>
  
  <pre><code>public function create()
          {
              $this-&gt;load-&gt;helper('form');
              $this-&gt;load-&gt;library('form_validation');
  
              $data['title'] = 'Create a news item';
  
              $this-&gt;form_validation-&gt;set_rules('title', 'Title', 'required');
              $this-&gt;form_validation-&gt;set_rules('text', 'Text', 'required');
  
              if ($this-&gt;form_validation-&gt;run() === FALSE)
              {
                  $this-&gt;load-&gt;view('templates/header', $data);
                  $this-&gt;load-&gt;view('news/create');
                  $this-&gt;load-&gt;view('templates/footer');
  
              }
              else
              {
                  $var = $this-&gt;news_model-&gt;set_news();
                  $this-&gt;load-&gt;view('news/SLUG/');
              }
          }
  </code></pre>
  
  <p>Now, what I'm trying to figure out how to do is use that <code>$slug</code> variable in the controller, to load the <code>view</code> of the article that was just posted - but I can't figure out how to access that variable after the data is submitted to the database.</p>