milesj / utility

[Deprecated] A CakePHP plugin for common utility classes.
MIT License
69 stars 24 forks source link

in your autologin you searched for _autoLogin as a method inside the controller.. can I declare _autoLogin as protected? #6

Closed simkimsia closed 11 years ago

simkimsia commented 11 years ago

I am trying to refactor my code to conform more to CakePHP standards.

For CakePHP standards, _methodName is meant for protected methods.

Can your autologin code still work if I change the _autoLogin in my UsersController to protected?

milesj commented 11 years ago

No, it has to be public. You can't call a protected method from outside of scope, that's just basic PHP rules, nothing to do with Cake. That's why its underscored, so that it can't be used as an action.

simkimsia commented 11 years ago

Understood.

I will use // @codingStandardsIgnoreStart to tell phpcs to ignore the related methods in my AppController.

Thank you.