本文整理汇总了PHP中Admin::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::instance方法的具体用法?PHP Admin::instance怎么用?PHP Admin::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::instance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
private static function getInstance()
{
if (empty(self::$instance)) {
self::$instance = new Admin();
}
return self::$instance;
}
示例2: newInstance
public static function newInstance()
{
if (!self::$instance instanceof self) {
self::$instance = new self();
}
return self::$instance;
}
示例3: getInstance
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new self();
}
return self::$instance;
}
示例4:
function __construct($mail = "", $mdp = "", $id = "", $ip = "", $nom = "", $prenom = "", $adresse = "", $cp = "", $ville = "", $qualite = "")
{
if (!isset(self::$instance)) {
self::$instance = parent::__construct($mail, $mdp, $id, $ip, $nom, $prenom, $adresse, $cp, $ville, $qualite);
}
return self::$instance;
}
示例5: it_provides_root_menu_items
/** @test */
public function it_provides_root_menu_items()
{
Admin::menu('My\\Model');
$items = Admin::instance()->getMenu();
$this->assertCount(2, $items);
$this->assertContainsOnlyInstancesOf('SleepingOwl\\Admin\\Menu\\MenuItem', $items);
}
示例6: init
public static function init()
{
if (!self::$instance) {
self::$instance = new self();
} else {
throw new Exception("Already initalized.");
}
}
示例7: function
<?php
Route::filter('admin.auth', function () {
if (AdminAuth::guest()) {
if (Request::ajax()) {
return Response::make('Unauthorized', 401);
} else {
return Redirect::guest(Admin::instance()->router->routeToAuth('login'));
}
}
});
示例8: __construct
{
function __construct()
{
}
public static function instance()
{
static $instance = null;
if ($instance === null) {
$instance = new Admin();
$instance->includes();
$instance->setup_actions();
}
return $instance;
}
private function includes()
{
require_once BBPKR_LIB . '/view.php';
require_once BBPKR_PATH . '/admin/forum.php';
require_once BBPKR_PATH . '/admin/meta.php';
Admin\Forum::init();
Admin\Meta::init();
require dirname(__FILE__) . '/settings.php';
Admin\Settings::init();
}
private function setup_actions()
{
do_action('bbpkr_admin_setup_actions');
}
}
$bbpkr_admin = Admin::instance();