StaticInstanceTrait
API reference › yii › base › StaticInstanceTrait
Used by 1 type
StaticInstanceTrait provides methods to satisfy StaticInstanceInterface interface.
See also: StaticInstanceInterface.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
instance() static | Returns static class instance, which can be used to obtain meta information. | StaticInstanceTrait |
Method details
Section titled “Method details”instance()
Section titled “instance() ”public static function instance(bool $refresh = false): staticReturns static class instance, which can be used to obtain meta information.
Parameters
| Parameter | Type | Description |
|---|---|---|
$refresh | bool | Whether to re-create static instance even, if it is already cached. |
Returns
static: Class instance.