Welcome Guest, Not a member yet? Register   Sign In
Multiple classes in one library
#3

[eluser]Phil Sturgeon[/eluser]
The above way will work fine, but do you really need them in the same file? Might get a little confusing like that and as the classes grow it will be a nightmare to maintain. The following would work fine as two files:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Testcenter
{
   function one
   {
   }
}

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Test extends Testcenter
{
   funtion addTest()
   {
   }
}
?>

Then you could load them like this:

Code:
$this->load->library('testcenter');
$this->load->library('test');


Messages In This Thread
Multiple classes in one library - by El Forum - 01-26-2009, 04:06 PM
Multiple classes in one library - by El Forum - 01-26-2009, 04:53 PM
Multiple classes in one library - by El Forum - 01-27-2009, 04:33 AM
Multiple classes in one library - by El Forum - 01-27-2009, 08:48 AM
Multiple classes in one library - by El Forum - 01-27-2009, 03:26 PM
Multiple classes in one library - by El Forum - 01-27-2009, 06:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB