本文整理汇总了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();
示例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;
}
}
示例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;
}
示例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);
}