We can load components in two ways.
Way-1 It should be override loading component by AppsController.php load one or more component
class UsersController extends AppController {
public $components = ['RequestHandler','Auth','Flash'];
}
Way-2 Use this way when you need load component dynamically for specific controller. Load One component
class UsersController extends AppController {
public function initialize() {
parent::initialize();
$this->loadComponent("RequestHandler"); // load specific component
$this->loadComponent(["RequestHandler","Auth","Flash"]); // load specific component
}
}