Welcome Guest, Not a member yet? Register   Sign In
help with custom classes
#1

[eluser]natefons[/eluser]
i read around on the forum, and it said to place custom classes in the library folder, but im not sure if that is exactly what i need to do.

i need a custom class that will in a nutshell be used more or less like a data type (if that's the right term?)
(please disregard any prebuilt classes to handle this, im using the below as an example)

lets say i have customers, they have:
a name
address
sex

i would, in regular php create a class called customers, with variables name,address,sex

now i can create numerous instances of this class as i want.
$x = new Customer();
$x2 = new Customer();

or i can place it in a for loop and create them dynamically.
for($i = .... etc etc..)
$x = new Customer()
do stuff


now how can i create a class like this in CI? can i do this in libraries?
for($i .. etc etc )
{
$x = $this->load->library('customer');
}

??

thanks for the help,
Nate
#2

[eluser]natefons[/eluser]
any help?




Theme © iAndrew 2016 - Forum software by © MyBB