title: Send a URI string to a model
body: <p>In CodeIgniter, I created a short URL processing function in my model that takes a URL sent by my controller as a parameter. To set the string that my model accepts I'm using the following:</p>
  
  <pre><code>$hash_str = end($this-&gt;uri-&gt;segments);
  $fullURL = (string)"http://example.com/$hash_str";
  </code></pre>
  
  <p>When I output <code>$fullURL</code> in the controller I get the "correct" URL</p>
  
  <pre><code>fb($fullURL) //outputs http://example.com/3fs3A
  </code></pre>
  
  <p>but when I process this in my model I get</p>
  
  <pre><code>fb($fullURL) //outputs http://example.com/%5Bobject%20Object%5D
  </code></pre>
  
  <p>How do I send the pre-processed string to my model or how do I get the end segment to convert correctly in my model?</p>