Jump to content

My user class


ttocskcaj

Recommended Posts

Move the instantiation of the settings class into the constructor and make it available for all methods to use.

 

eg (in the class)

 


public $settings;

function __construct()
{
    $this->settings = new settings();
}

 

Then in your methods (isBanned, login, register) you can refer to the settings object as $this->settings, rather than repeating code to instantiate. This leaves your code cleaner, less lines and more maintainable.

Link to comment
https://forums.phpfreaks.com/topic/224156-my-user-class/#findComment-1158288
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.