当前位置: 首页>>代码示例>>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;未经允许,请勿转载。