username = $user; $this->password = $pass; } } $admin = new Admin_Controller("admin", "password"); //creates a new instance of Admin_Controller and initializes it with dummy values. ?>
In this example, the Admin_Controller class extends the built-in CI_Controller class from the CodeIgniter framework. The __construct function is used to call the parent::__construct function to initialize the parent class and any of its properties and values. Additional initialization code can be added to this function as needed. Package/Library: CodeIgniter Framework.