class User_Controller extends Admin_Controller { ... }
class Admin_Controller { public function __construct() { if (!user_logged_in()) { redirect_to('/login'); } } }This code adds a constructor to the Admin_Controller class that checks if the user is logged in. If they are not, the page is redirected to the login page. Package Library: Admin_Controller is often used as a part of a larger PHP framework or library, such as CodeIgniter, Laravel, or CakePHP.