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


PHP UserController::index方法代碼示例

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


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

示例1: function

    SessionController::store();
});
$routes->get('/login', function () {
    SessionController::create();
});
$routes->get('/logout', function () {
    SessionController::destroy();
});
$routes->get('/signup', function () {
    UserController::create();
});
$routes->post('/signup', function () {
    UserController::store();
});
$routes->get('/user', function () {
    UserController::index();
});
$routes->get('/user/:id', function ($id) {
    UserController::show($id);
});
$routes->post('/user/:id', function ($id) {
    UserController::update($id);
});
$routes->get('/user/:id/edit', function ($id) {
    UserController::edit($id);
});
$routes->get('/user/:id/destroy', function ($id) {
    UserController::destroy($id);
});
$routes->get('/group', function () {
    GroupController::index();
開發者ID:tuureilmarinen,項目名稱:tsoha,代碼行數:31,代碼來源:routes.php

示例2: redirectUrl

 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
include_once "includes/sp-load.php";
if (isLoggedIn() && $_GET['sec'] != 'logout') {
    redirectUrl(SP_WEBPATH . "/");
}
include_once SP_CTRLPATH . "/user.ctrl.php";
$controller = new UserController();
$controller->view->menu = 'login';
$controller->set('spTitle', 'Seo Panel: Login section');
$controller->set('spDescription', 'Login to Seo Panel and utilise seo tools and plugins to increase the perfomance of your site.');
$controller->set('spKeywords', 'Seo Panel Login section');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    switch ($_POST['sec']) {
        case "login":
            $controller->login();
            break;
        default:
            $controller->index();
            break;
    }
} else {
    switch ($_GET['sec']) {
        case "logout":
            $controller->logout();
            break;
        default:
            $controller->index();
            break;
    }
}
開發者ID:codegooglecom,項目名稱:seopanel,代碼行數:31,代碼來源:login.php

示例3: UserController

$controller = new UserController();
$controller->view->menu = 'login';
$controller->set('spTitle', 'Seo Panel: Login section');
$controller->set('spDescription', 'Login to Seo Panel and utilise seo tools and plugins to increase the perfomance of your site.');
$controller->set('spKeywords', 'Seo Panel Login section');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    switch ($_POST['sec']) {
        case "login":
            $controller->login();
            break;
        case "requestpass":
            $controller->set('spTitle', 'Seo panel forgot password');
            $controller->requestPassword($_POST['email']);
            break;
        default:
            $controller->index();
            break;
    }
} else {
    switch ($_GET['sec']) {
        case "logout":
            $controller->logout();
            break;
        case "forgot":
            $controller->set('spTitle', 'Seo Panel forgot password');
            $controller->forgotPasswordForm();
            break;
        default:
            $controller->index($_GET);
            break;
    }
開發者ID:codegooglecom,項目名稱:seopanel,代碼行數:31,代碼來源:login.php

示例4: UserModel

<?php

require "vendor/autoload.php";
error_reporting(E_ALL);
ini_set("display_errors", "On");
//simpler routing mechanism for serving pages
$link = $_SERVER['REQUEST_URI'];
$userModel = new UserModel();
$userController = new UserController($userModel);
$catalogModel = new CatalogModel();
$catalogModel->setCatalog();
$catalogController = new CatalogController($catalogModel);
if ($link === '/') {
    $userController->index();
} elseif ($link === '/login') {
    $username = $_POST['username'];
    $password = $_POST['password'];
    $form_token = $_POST['form_token'];
    $userController->login($username, $password, $form_token);
} elseif ($link === '/logout') {
    $userController->logout();
} elseif ($link === '/catalog') {
    $catalogController->index();
} elseif ($link === '/order') {
    $json = $_POST['order'];
    $catalogController->order($json);
}
開發者ID:kmaxat,項目名稱:storefront,代碼行數:27,代碼來源:index.php


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