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


PHP UserController::insertUser方法代碼示例

本文整理匯總了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);
         });
     });
 }
開發者ID:rachellcarbone,項目名稱:angular-seed,代碼行數:40,代碼來源:user.routes.php

示例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";
開發者ID:saulocamposi,項目名稱:cmsImperativo,代碼行數:31,代碼來源:UserRegisterController.php


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