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


PHP LuLu::getPostValue方法代碼示例

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


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

示例1: actionIndex

 /**
  * Lists all Relation models.
  * @return mixed
  */
 public function actionIndex($role)
 {
     if (\Yii::$app->request->isPost) {
         $selectedPermissions = LuLu::getPostValue('Permission');
         Relation::AddBatchItems($role, $selectedPermissions);
         return $this->redirect(['index', 'role' => $role]);
     }
     $allPermissions = Permission::getAllPermissionsGroupedByCategory();
     $rolePermissions = Relation::find()->select(['permission', 'value'])->where(['role' => $role])->indexBy('permission')->all();
     $categories = Permission::getCategoryItems();
     $role = Role::findOne(['id' => $role]);
     return $this->render('index', ['rolePermissions' => $rolePermissions, 'allPermissions' => $allPermissions, 'categories' => $categories, 'role' => $role]);
 }
開發者ID:snowbai,項目名稱:lulucms2,代碼行數:17,代碼來源:RelationController.php

示例2: actionRole

 public function actionRole($user)
 {
     $userRoles = Assignment::find()->select('role')->where(['user' => $user])->indexBy('role')->all();
     if (\Yii::$app->request->isPost) {
         $selectedRoles = LuLu::getPostValue('roles', []);
         Assignment::deleteAll(['and', 'user=\'' . $user . '\'', ['not in', 'role', $selectedRoles]]);
         foreach ($selectedRoles as $selectedRole) {
             if ($userRoles != null && isset($userRoles[$selectedRole])) {
                 continue;
             }
             $newAssignment = new Assignment();
             $newAssignment->user = $user;
             $newAssignment->role = $selectedRole;
             $newAssignment->save();
         }
         return $this->redirect(['role', 'user' => $user]);
     }
     $allRoles = Role::findAll();
     return $this->render('role', ['userRoles' => $userRoles, 'allRoles' => $allRoles]);
 }
開發者ID:hucongyang,項目名稱:lulucms2,代碼行數:20,代碼來源:AssignmentController.php

示例3: actionIndex

 /**
  * Lists all Relation models.
  * @return mixed
  */
 public function actionIndex($role)
 {
     $rolePermissions = Relation::find()->select(['permission', 'value'])->where(['role' => $role])->indexBy('permission')->all();
     if (\Yii::$app->request->isPost) {
         var_dump(LuLu::getPostValue('Permission'));
         $selectedPermissions = LuLu::getPostValue('Permission');
         $keys = array_keys($selectedPermissions);
         Relation::deleteAll(['role' => $role]);
         foreach ($selectedPermissions as $key => $value) {
             $newRelation = new Relation();
             $newRelation->role = $role;
             $newRelation->permission = $key;
             $newRelation->value = is_string($value) ? $value : implode(',', $value);
             $newRelation->save();
         }
         return $this->redirect(['index', 'role' => $role]);
     }
     $allPermissions = Permission::findAll();
     return $this->render('index', ['rolePermissions' => $rolePermissions, 'allPermissions' => $allPermissions]);
 }
開發者ID:merlinxie,項目名稱:lulublog,代碼行數:24,代碼來源:RelationController.php

示例4: insertAdmin

 private function insertAdmin($db)
 {
     $username = LuLu::getPostValue('username');
     $password = LuLu::getPostValue('password');
     $email = LuLu::getPostValue('email');
     $tbPre = $db->tablePrefix;
     $user = new \source\models\User();
     $user->scenario = 'create';
     $user->username = $username;
     $user->password = $password;
     $user->email = $email;
     $user->role = 'administrator';
     $user->status = Constants::Status_Enable;
     $user->save();
     //$db->createCommand("INSERT INTO `" . $tbPre . "user`(`username`, `password`,`group_id`, `email`,`create_time`) VALUES('" . $username . "','" . md5($password) . "','1','" . $email . "', " . time() . ");")->execute();
 }
開發者ID:sym660,項目名稱:lulucms2,代碼行數:16,代碼來源:SiteController.php


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