Controller::register()
Registers the filters and actions hooks added by the controller if the controller has not registered yet.
Return
(void)
Source
File: src/Conference/Contracts/Provider/Controller.php
public function register() {
/*
* Look up and set the value in the container request cache to allow building the same Controller
* with a **different** container. (e.g. in tests).
*/
if ( static::is_registered() ) {
return;
}
// Register the controller as a singleton in the container.
// @todo remove when the Container is updated to bind Providers as singletons by default.
$this->container->singleton( static::class, $this );
if ( ! $this->is_active() ) {
return;
}
$this->container->setVar( static::class . '_registered', true );
$this->do_register();
}
Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |