/** * @return Bootstrap */ public static function factory() { if (!is_null(self::$_instance)) { return self::$_instance; } return self::$_instance = new self(); }
public static function getInstance() { if (!self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
public static function instance() { if (self::$_instance === false) { self::$_instance = new Bootstrap(); } return self::$_instance; }
/** * @return Bootstrap * @since 2.1.0 */ public static function getBooster() { if (null === self::$_instance) { // Lets find inside current module $module = Yii::app()->getController()->getModule(); if ($module) { if ($module->hasComponent('bootstrap')) { self::$_instance = $module->getComponent('bootstrap'); } } // Still nothing? if (null === self::$_instance) { if (Yii::app()->hasComponent('bootstrap')) { self::$_instance = Yii::app()->getComponent('bootstrap'); } } } return self::$_instance; }