createControllerByID() public method

The controller ID is relative to this module. The controller class should be namespaced under [[controllerNamespace]]. Note that this method does not check [[modules]] or [[controllerMap]].
public createControllerByID ( string $id ) : Controller
$id string the controller ID.
return Controller the newly created controller instance, or `null` if the controller ID is invalid.
Beispiel #1
0
 public function createControllerByID($id)
 {
     if ($id == 'security' && !$this->enableSecurityHandler) {
         return null;
     } else {
         return parent::createControllerByID($id);
     }
 }