本文整理汇总了PHP中FrontController::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP FrontController::instance方法的具体用法?PHP FrontController::instance怎么用?PHP FrontController::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrontController
的用法示例。
在下文中一共展示了FrontController::instance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
/**
* Singleton method that returns a unique instance of the class.
*
* @return FrontController
*/
private static function getInstance()
{
if (!self::$instance instanceof self) {
self::$instance = new self();
}
return self::$instance;
}
示例2: getInstance
public static function getInstance()
{
if (self::$instance == false) {
self::$instance = new FrontController();
}
return self::$instance;
}
示例3: getInstance
/**
* Returns an instance of FrontController object
* @return FrontController
*/
public static function getInstance()
{
if (self::$instance === null) {
self::$instance = new self();
}
return self::$instance;
}
示例4: getInstance
public static function getInstance()
{
if (f::isEmpty(self::$instance)) {
$class = __CLASS__;
self::$instance = new $class();
}
return self::$instance;
}
示例5: getInstance
/**
* getInstance - just one instance of the object is allowed (it makes no sense to have more)
*
* @access public static
* @param $rootPath
* @return object (instance)
*/
public static function getInstance($rootPath = null)
{
if (is_object(self::$instance) === false) {
if (is_null($rootPath)) {
throw new Exception('No root path');
}
self::$instance = new FrontController($rootPath);
}
return self::$instance;
}
示例6: getInstance
/**
* the getInstance() method returns a single instance of the object
*/
public static function getInstance()
{
if (!isset(self::$instance)) {
spl_autoload_register(array('FrontController', 'autoLoad'));
$object = __CLASS__;
self::$instance = new $object();
self::$instance->initApp();
}
return self::$instance;
}