[eluser]peekk[/eluser]
Hello, I'm new in CI programming, and I have some issues right now.
I have 2 PHP classes, let's call them class1 and class2.
In class1 I have method, which creates an object of class2 and does a method from class2 on it.
I created a two models, Class1 and Class2 and now I have no idea how can I call methods from Class2 in Class1.
class examples:
Code:
class Class1{
public function createclass2()
{
return new Class2();
}
protected function useclass2()
{
return $this->createclass2()->class2funct();
}
}
class Class2{
public function class2funct(){
echo 'I did it';
}
}
Can you suggest me, how to resolve it, maybe should I use libraries? I don't know how to create these class structures that I used to make in traditional PHP, now in CodeIgniter environment.
Thanks in advance.