class UserModule {
public static function getUserId() { ... }
public static function removeUser( $id ) { ... }
}
UserModule::removeUser( 11 );
PHP Coding tips & tricks. Function & error explanation, coding style, how tos etc. Short notes posted directly from developer work environment.
PHP Coding Tips
Tuesday, August 7, 2012
Organize your global functions to static methods - alternative to structural/procedural programming
If you are not into Object Oriented Programming, and include files and functions everywhere, you can get lost in your own function names.
The good alternative is to group your functions into classes with static methods:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment