title: How to use Third Party Class with Codeigniter
body: <p>So I must be having a brain fart and need a hand. I'm trying to use <a href="https://github.com/dvdoug/BoxPacker" rel="nofollow noreferrer">BoxPacker</a> in my Codeigniter project to figure out how many items I can fit in some boxes. I've installed BoxPacker into a "application/third_party/boxpacker" folder. But now how do I actually use it? </p>
  
  <p>For some reason my brain is telling me I have to make my own library to interface with the third party programming but then I just have another brain fart and have no clue how to implement it. It's been a long week so I'm pretty burnt out and looking for a hand. </p>
  
  <p><strong>EDIT:</strong> 
  So, I created a library named BoxPacker.php with the following code: `    
  
  <pre><code>class BoxPacker
  {
      function __construct()
      {
          require_once APPPATH."third_party/boxpacker/vendor/autoload.php";
      }
  }
  </code></pre>
  
  <p>In my controller I then call: </p>
  
  <p><code>$this-&gt;load-&gt;library('BoxPacker');
   $packer = new BoxPacker();</code></p>
  
  <p>But when I try using the functions in the third part code like below, I get the following error <code>Exception: Call to undefined method BoxPacker::addBox()</code>: </p>
  
  <p><code>$packer-&gt;addBox(new TestBox('Le petite box', 300, 300, 10, 10, 296, 296, 8, 1000));</code></p>