Welcome Guest, Not a member yet? Register   Sign In
How to create an object of a class in CI
#1

[eluser]doors[/eluser]
After reading the documentation i have seen that in order to load in a class I have to do this:

$this->load('class_name');

When this is done I can access the class object by using:

$this->class_name;

My question is how do I create as many object as I want? Can I still do $obj = new class_name(); ?
#2

[eluser]TSOL[/eluser]
Yes you can...

$Manager = new Person();
$Employee = new Person();



[quote author="doors" date="1202169560"]After reading the documentation i have seen that in order to load in a class I have to do this:

$this->load('class_name');

When this is done I can access the class object by using:

$this->class_name;

My question is how do I create as many object as I want? Can I still do $obj = new class_name(); ?[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB