當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dashboard::index方法代碼示例

本文整理匯總了PHP中Dashboard::index方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dashboard::index方法的具體用法?PHP Dashboard::index怎麽用?PHP Dashboard::index使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dashboard的用法示例。


在下文中一共展示了Dashboard::index方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isset

 function __construct()
 {
     global $url;
     $url = isset($_GET['url']) ? $_GET['url'] : null;
     $url = rtrim($url, '/');
     $url = explode('/', $url);
     $this->db = new Database();
     if (!isset($_SESSION['x_equi']) && $url[0] != 'login') {
         header("location:" . _EQROOT_ . 'login');
     }
     if (empty($url[0])) {
         require 'controllers/dashboard.php';
         $controller = new Dashboard();
         $controller->index();
         return false;
     }
     $file = 'controllers/' . $url[0] . '.php';
     if (file_exists($file)) {
         require $file;
         $controller = new $url[0]();
         $controller->loadModel($url[0]);
         // calling methods
         if (isset($url[2])) {
             if (method_exists($controller, $url[1])) {
                 $controller->{$url[1]}($url[2]);
             } else {
                 $this->error();
             }
         } else {
             if (isset($url[1])) {
                 if (method_exists($controller, $url[1])) {
                     $controller->{$url[1]}();
                 } else {
                     $this->error();
                 }
             } else {
                 $controller->index();
             }
         }
     } else {
         $this->error();
     }
 }
開發者ID:eddythemeddy,項目名稱:Equinox-CMS,代碼行數:43,代碼來源:Bootstrap.php

示例2: explode

 function __construct()
 {
     //parent::_construct();
     global $database;
     $vari = $_SERVER['REQUEST_URI'];
     $vari = explode("/", $vari);
     if (isset($_GET['url'])) {
         $url = $_GET['url'];
         $url = rtrim($url);
         $url = explode('/', $_GET['url']);
     } else {
         $url = null;
     }
     if (empty($url[0])) {
         require "controllers/dashboard.php";
         $controller = new Dashboard();
         $controller->index();
         exit;
     }
     $file = "controllers/" . $url[0] . ".php";
     if (file_exists($file)) {
         require $file;
     } elseif ($vari[1] == 'scratch' && count($vari) === 3) {
         require "controllers/pages.php";
         $controller = new Pages();
         $controller->index();
         exit;
     } else {
         require "controllers/error.php";
         $controller = new Error();
         return false;
     }
     $controller = new $url[0]();
     if (isset($url[2]) && !empty($url[2])) {
         $controller->{$url[1]}($url[2]);
     } else {
         if (isset($url[1])) {
             $controller->{$url[1]}();
         }
     }
 }
開發者ID:runningjack,項目名稱:RobertJohnson,代碼行數:41,代碼來源:bootstrap.php

示例3: function

});
$route->respond('POST', '/store', function ($request, $response) use($home) {
    return $home->store($request, $response);
});
$route->respond('GET', '/login', function () use($home) {
    echo $home->getLogin();
    unset($_SESSION['flash']);
});
$route->respond('POST', '/login', function ($request, $response, $service) use($home) {
    return $home->postLogin($request, $response, $service);
});
$route->respond('GET', '/logout', function ($request, $response, $service) use($home) {
    return $home->logout($request, $response, $service);
});
$route->respond('GET', '/dashboard/index', function ($request, $response) use($dashboard) {
    return $dashboard->index($request, $response);
});
$route->respond('GET', '/dashboard/show', function ($request, $response) use($dashboard) {
    return $dashboard->show($request, $response);
});
$route->respond('GET', '/dashboard/delete/[i:id]', function ($request, $response) use($dashboard) {
    return $dashboard->delete($request, $response);
});
$route->respond('GET', '/dashboard/edit/[i:id]', function ($request, $response) use($dashboard) {
    return $dashboard->edit($request, $response);
});
$route->respond('POST', '/dashboard/edit/[i:id]', function ($request, $response) use($dashboard) {
    return $dashboard->update($request, $response);
});
$route->respond('GET', '/dashboard/leave/index', function ($request, $response) use($leave) {
    return $leave->index($request, $response);
開發者ID:nahidex,項目名稱:Employee-Leave-Management-,代碼行數:31,代碼來源:routes.php


注:本文中的Dashboard::index方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。