Zoe Zoe
asked on
Use inside class versus outside class
Recently, I've had to put Use inside a class but I've always seen it put outside the class. What's the difference? When do I need to put it inside and when do I need to put it outside? If I put it outside, I get an error saying that I have an undefined method.
class MY_Controller extends CI_Controller
{
use Auth;
}
use Auth;
class MY_Controller extends CI_Controller
{
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.