Welcome Guest, Not a member yet? Register   Sign In
Multiple Classes inside a library
#1

[eluser]DaveLittle[/eluser]
I'm quite new to codeigniter, and was wondering is it possible with Codeigniter to have a library which contain's multiple classes in?

I basically need to build a library to communicate with my merchant company's API. The provider has given me the code to incorporate into a hard coded site, there is basically 3 files containing multiple classes in each: PaymentSystem.php, SOAP.php and Common.php

Is it possible to create 3 libraries containing all of the classes, load them into the controller and inside my controller function and create new instance for example like this:

Code:
class Payment_controller extends CI_Controller
{
public function index()
    {
     $this->load->library('PaymentSystem');

        $rgeplRequestGatewayEntryPointList = new RequestGatewayEntryPointList();
        // Or maybe I would have to do it like this sorry I am abit of a n00b!
        $rgeplRequestGatewayEntryPointList = $this->PaymentSystem->new RequestGatewayEntryPointList();
    }

}

Or do I need to separate each class into individual libraries and load each one?

Or would i be better off just using require_once within the controller and leave the files as they are?

Or am i approaching this completely the wrong way!


Messages In This Thread
Multiple Classes inside a library - by El Forum - 10-04-2012, 07:56 AM
Multiple Classes inside a library - by El Forum - 10-04-2012, 08:03 AM
Multiple Classes inside a library - by El Forum - 10-04-2012, 08:16 AM
Multiple Classes inside a library - by El Forum - 10-04-2012, 08:23 AM
Multiple Classes inside a library - by El Forum - 10-04-2012, 08:54 AM
Multiple Classes inside a library - by El Forum - 10-04-2012, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB