Welcome Guest, Not a member yet? Register   Sign In
Objects from custom classes
#2

[eluser]crumpet[/eluser]
The way i deal with this is to create a library called lib_twit.php
in that file there are two class declarations
Code:
class lib_twit{
   function create(){
       return new twit();
   }
}
class twit{
//this is your class
}
Then when you need to use it you go
Code:
$this->load->library('lib_twit');
foreach(...){
   $return[] = $this->lib_twit->create();
}
return $return;


Messages In This Thread
Objects from custom classes - by El Forum - 11-30-2008, 03:25 PM
Objects from custom classes - by El Forum - 11-30-2008, 04:24 PM
Objects from custom classes - by El Forum - 11-30-2008, 04:45 PM
Objects from custom classes - by El Forum - 11-30-2008, 05:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB