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


PHP User::process方法代码示例

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


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

示例1: process

 /**
  * Process action method
  *
  * @return void
  */
 public function process()
 {
     if ($this->request->isPost()) {
         $user = new Model\User();
         $user->process($this->request->getPost(), $this->application->config()['application_title']);
     }
     if (null !== $this->request->getPost('user_process_action') && $this->request->getPost('user_process_action') == -1) {
         $this->sess->setRequestValue('removed', true);
     } else {
         $this->sess->setRequestValue('saved', true);
     }
     $this->redirect('/users' . ((int) $this->request->getPost('role_id') != 0 ? '/' . (int) $this->request->getPost('role_id') : null));
 }
开发者ID:popphp,项目名称:pop-bootstrap,代码行数:18,代码来源:IndexController.php

示例2: remove

 /**
  * Remove action method
  *
  * @return void
  */
 public function remove()
 {
     $roleId = $this->getRoleId();
     $user = new Model\User();
     $users = $user->getAll($roleId);
     $userIds = [];
     $this->console->append();
     $this->console->append("ID  \tUsername\tEmail");
     $this->console->append("----\t--------\t-----");
     foreach ($users as $user) {
         $userIds[] = $user->id;
         $this->console->append($user->id . "\t" . $user->username . "\t\t" . $user->email);
     }
     $this->console->append();
     $this->console->send();
     $userId = null;
     while (!is_numeric($userId) || !in_array($userId, $userIds)) {
         $userId = $this->console->prompt('Select User ID: ');
     }
     $user = new Model\User();
     $user->process(['process_users' => [$userId], 'user_process_action' => -1], $this->application->config()['application_title']);
     $this->console->write();
     $this->console->write($this->console->colorize('User Removed!', Console::BOLD_RED));
 }
开发者ID:popphp,项目名称:pop-bootstrap,代码行数:29,代码来源:UsersController.php


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