title: How can I instantiate multiple instances of the same object in Codeigniter?
body: <p>With traditional OOP, i would (or could, rather) create a model / object that represents a <code>User</code>, with properties that reflect that, i.e. <code>name</code>, <code>id</code>, <code>job title</code> etc.</p>
  
  <p>I could then create a new instance of that object and assign it to a variable, and if i was looping through a result set, i could create an instance for each one. With codeigniter, this seems impossible, as doing:</p>
  
  <pre><code>$this-&gt;load-&gt;model('User');
  </code></pre>
  
  <p>Instantiates it, and places it for use at <code>$this-&gt;user</code>.</p>
  
  <p>Is there no way to use models as objects in a more traditional manner?, but without hacking the CI way of doing things?</p>
  
  <p>I understand that you can assign things to a different object name using <code>$this-&gt;load-&gt;model('User', 'fubar')</code>, but it's not as dynamic as simply assigning an instance to a variable.</p>
  
  <p>Any insight into the matter is greatly appreciated guys.</p>
  
  <p><strong>EDIT:</strong> thanks for the answers guys, i think that i missed a vital part of working the "Codigniter Way", but i've just been looking through a contributed library, and the practice of using the same instance (assigned to the codeigniter namespace) but clearing the instance variables after each use, seems to be a great way to work that removes my reservations.</p>
  
  <p>Once again - thanks for the help and answers.</p>