本文整理汇总了PHP中UserController::insertUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserController::insertUser方法的具体用法?PHP UserController::insertUser怎么用?PHP UserController::insertUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserController
的用法示例。
在下文中一共展示了UserController::insertUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addRoutes
static function addRoutes($app, $authenticateForRole)
{
//* /user/id - members can get their own profile
$app->map("/user/get/:userId/", $authenticateForRole('member'), function ($userId) use($app) {
UserController::selectUser($app, $userId);
})->via('GET', 'POST');
/*
* id, nameFirst, nameLast, email, phone
*/
$app->post("/user/update/:userId/", $authenticateForRole('member'), function ($userId) use($app) {
UserController::updateUser($app, $userId);
});
//* /user/ routes - admin users only
$app->group('/user', $authenticateForRole('admin'), function () use($app) {
/*
* nameFirst, nameLast, email, password
*/
$app->post("/insert/", function () use($app) {
UserController::insertUser($app);
});
/*
* id
*/
$app->map("/delete/:userId/", function ($userId) use($app) {
UserController::deleteUser($app, $userId);
})->via('DELETE', 'POST');
/*
* userId, groupId
*/
$app->post("/unassign-group/", function () use($app) {
UserController::unassignGroup($app);
});
/*
* userId, groupId
*/
$app->post("/assign-group/", function () use($app) {
UserController::assignGroup($app);
});
});
}
示例2: Conecta
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
if (!empty($_GET)) {
print_r($_GET);
include "../model/Conecta.php";
include "../model/dao/userDao/DaoUserRegister.php";
include "../model/beans/UserRegister.php";
include "class/UserController.php";
include "class/UserControllerOfficial.php";
$conecta = new Conecta();
$daoUserRegister = new DaoUserRegister();
$modelUserRegister = new UserRegister();
$userService = new UserController($_POST, $conecta, $daoUserRegister, $modelUserRegister);
if ($_GET["action"] == "insert") {
$userService->processDataForm();
$userService->insertUser();
header("Location:../userRegister.php");
}
if ($_GET["action"] == "update") {
print "deveria cair aqui";
}
if ($_GET["action"] == "delete") {
$userService->deleteUser($_GET["id"]);
header("Location:../cadastrar.php");
}
if ($_GET["action"] == "view") {
}
} else {
include "model/Conecta.php";
include "model/dao/userDao/DaoUserRegister.php";
include "model/beans/UserRegister.php";