call one of the method from another class |
[eluser]Uresh Patel[/eluser]
Respected, I have two controllers.I want to call one of the method from one class. Below both class are different controller files E.g: Code: class User extends CI_Controller {
[eluser]Otemu[/eluser]
Hi, The best way to do something like this is either create a library or helper. Also check out this excellent article CodeIgniter Base Classes: Keeping it DRY. Hope that helps
[eluser]Uresh Patel[/eluser]
HI, Thank you for reply.But i am looking forward to have a proper solution.i have foggy idea but not clear with it. We can create instance or can we do like language "C++" using friend function using that access modifier ????? [quote author="Otemu" date="1366624431"]Hi, The best way to do something like this is either create a library or helper. Also check out this excellent article CodeIgniter Base Classes: Keeping it DRY. Hope that helps[/quote]
[eluser]jairoh_[/eluser]
do not use the controller. the proper way is to use model or library or helper. it depends. tell us the purpose of the add function. |
Welcome Guest, Not a member yet? Register Sign In |