当前位置: 首页>>代码示例>>PHP>>正文


PHP UserController::createUserForm方法代码示例

本文整理汇总了PHP中UserController::createUserForm方法的典型用法代码示例。如果您正苦于以下问题:PHP UserController::createUserForm方法的具体用法?PHP UserController::createUserForm怎么用?PHP UserController::createUserForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserController的用法示例。


在下文中一共展示了UserController::createUserForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: users

 public function users()
 {
     $id = (int) $this->request->get("id");
     $response = new ActionResponse();
     $availableUserGroups = array('' => $this->translate('_default_user_group'));
     foreach (UserGroup::getRecordSet(new ARSelectFilter()) as $group) {
         $availableUserGroups[$group->getID()] = $group->name->get();
     }
     $form = UserController::createUserForm($this, null, $response);
     $form->setData(array_merge($form->getData(), array('UserGroup' => $id, 'ID' => 0, 'isEnabled' => 1)));
     $response->set('newUser', array('UserGroup' => array('ID' => $id), 'ID' => 0, 'isEnabled' => 1));
     $response->set('availableUserGroups', $availableUserGroups);
     $response->set('form', $form);
     $response->set('countries', array_merge(array('' => ''), $this->application->getEnabledCountries()));
     $response->set("userGroupID", $id);
     $this->setGridResponse($response);
     return $response;
 }
开发者ID:saiber,项目名称:livecart,代码行数:18,代码来源:UserGroupController.php

示例2: quickEdit

 public function quickEdit()
 {
     $this->loadQuickEditLanguageFile();
     $request = $this->getRequest();
     $userID = $request->get('id');
     $user = User::getInstanceByID($userID, ActiveRecordModel::LOAD_DATA, array('UserGroup'));
     $f = new ARSelectFilter(new EqualsCond(new ARFieldHandle('CustomerOrder', 'userID'), $user->getID()));
     $f->setOrder(new ARFieldHandle('CustomerOrder', 'dateCompleted'), 'desc');
     $customerOrders = ActiveRecordModel::getRecordSet('CustomerOrder', $f, ActiveRecordModel::LOAD_REFERENCES);
     $response = new ActionResponse();
     $response->set('someUser', $user->toArray());
     $lastOrder = false;
     $ordersArray = array();
     if ($customerOrders->size() > 0) {
         $i = 0;
         foreach ($customerOrders as $order) {
             $order->loadAddresses();
             $order->getShipments();
             $order->loadDiscounts();
             $ordersArray[$i] = $order->toArray();
             $ordersArray[$i]['status_name'] = CustomerOrder::getStatusName($ordersArray[$i]['status'] ? $ordersArray[$i]['status'] : CustomerOrder::STATUS_NEW);
             $i++;
         }
         $response->set('orders', $ordersArray);
         $response->set('lastOrder', $ordersArray[0]);
     }
     $form = UserController::createUserForm($this, $user, $response);
     $response->set('form', $form);
     $availableUserGroups = array('' => $this->translate('_default_user_group'));
     foreach (UserGroup::getRecordSet(new ARSelectFilter()) as $group) {
         $availableUserGroups[$group->getID()] = $group->name->get();
     }
     $response->set('availableUserGroups', $availableUserGroups);
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:35,代码来源:UserGroupController.php


注:本文中的UserController::createUserForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。