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


PHP User::getUser方法代码示例

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


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

示例1: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @param  User $modelUser
  * @return \Illuminate\Http\Response
  */
 public function show(User $modelUser, $id)
 {
     $user = $modelUser->getUser($id);
     if (!$user->count()) {
         //            return redirect('404');
         abort('404');
     }
     $friendshipExist = $modelUser->friendshipExists(Auth::id(), $id);
     $hobbies = $modelUser->getHobbies($id);
     $friends = $modelUser->getApprovedFriends($id);
     return view('profile', ['user' => $user, 'hobbies' => $hobbies, 'friends' => $friends, 'friendshipExist' => $friendshipExist]);
 }
开发者ID:Colls,项目名称:meetings.laravel,代码行数:19,代码来源:UserController.php

示例2: index

 public function index()
 {
     $user = new User();
     $config = new Config();
     $current_user = $user->getUser();
     $todo = new todo\Todo();
     $task = $user->getTask();
     $data = array();
     $data['title'] = 'Sample TODO App';
     //		$data['firstname'] = $current_user->getName();
     //		$data['task'] = $task->getTaskName();
     $data['message'] = 'Here is a message created in our Home controller';
     $data['root'] = $config->getWebRoot();
     $data['home_url'] = $config->getHomeURL();
     // Lets load our views
     $this->view->getView('header', $data, TRUE);
     $this->view->getView('home', $data);
     $this->view->getView('footer', $data, TRUE);
 }
开发者ID:scjhawk,项目名称:GrassRootsMVC,代码行数:19,代码来源:Home.php

示例3: actionLogin

 /**
  * action for login in system
  * @return string
  */
 public function actionLogin()
 {
     $response = null;
     if (\Yii::$app->request->isAjax) {
         $request = \Yii::$app->request;
         $user = new \app\models\User();
         $user->setPassword($request->post('password'));
         if ($user->checkUser($request->post('username'), $request->post('password'))) {
             return '1';
         }
         return '0';
     } else {
         $request = \Yii::$app->request;
         $user = new \app\models\User();
         $user->username = $request->post('username');
         $user->setPassword($request->post('password'));
         if ($user->checkUser($request->post('username'), $request->post('password'))) {
             $l = \Yii::$app->user->login($user->getUser());
             $this->redirect('/' . ($l ? $user->findByUsername($request->post('username'))->username : ''));
         }
     }
 }
开发者ID:pyvil,项目名称:yii-app,代码行数:26,代码来源:WelcomeController.php

示例4: getPage

 function getPage($page)
 {
     $params = [];
     if (User::isLogged()) {
         $u = User::getUser();
         $explodeName = explode(' ', $u->user_name);
         $first = strlen($explodeName[0]) > 0 ? $explodeName[0] : '';
         $last = isset($explodeName[1]) > 0 ? $explodeName[1] : '';
         $params['userName'] = $u->user_name;
         $params['userInfo'] = $u;
         $params['firstName'] = $first;
         $params['lastName'] = $last;
     }
     if (!User::isLogged()) {
         return view('login');
     }
     switch ($page) {
         case 'inicio':
             return view('home')->with($params);
             break;
         case 'perfil':
             return view('profile')->with($params);
             /*$user = User::getUser($_SESSION['ina_user']['id']);
               $user_ext = User::join("state","state.id","=","user.state_id")->join("country","country.id","=","state.country_id")->where("user.id","=",$_SESSION['ina_user']['id'])->get(array("country.phone_ext"))->first();
               $params['page']['ext']=$user_ext->phone_ext;
               return view('profile', array('user' => $user))->with($params);*/
             break;
         case 'catalogos':
             $params['departments'] = Department::getAllDepartments();
             return view('catalogs')->with($params);
             break;
         case 'pacientes':
             return view('patients')->with($params);
             break;
         default:
             break;
     }
 }
开发者ID:khrizenriquez,项目名称:agh-sistema-interno-web,代码行数:38,代码来源:PageController.php

示例5: getActivate

 /**
  * Activates user
  *
  * @param int $id User id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function getActivate($id)
 {
     $user = User::getUser($id, true);
     $user->deleted_at = null;
     $user->save();
     User::flushCache($user);
     flash()->success(trans('users.activated_success'));
     return redirect()->back();
 }
开发者ID:noikiy,项目名称:Laravel5Starter,代码行数:15,代码来源:AdminUsersController.php

示例6: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id, User $userModel)
 {
     $user = $userModel->getUser($id);
     if (count($user) < 1) {
         abort(404);
     }
     return view('users.edit')->with('title', 'Настройки пользователя ' . $user->showname)->with('user', $user);
 }
开发者ID:enotsokolov,项目名称:vp_plus,代码行数:14,代码来源:UserController.php

示例7: saveHistory

 public function saveHistory($action, $object = null, $dop = null)
 {
     switch ($action) {
         case 'create_category':
             $message = "Создал категорию [" . $object . "]";
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'rename_category':
             $message = "Переименовал категорию [" . $object . "]";
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'move_category':
             $categoryModel = new Category();
             $category = $categoryModel->getCategory($object, array('name'));
             $message = "Переименовал категорию [" . $category->name . "]";
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'status_category':
             $categoryModel = new Category();
             $category = $categoryModel->getCategory($object, array('name'));
             if ($dop) {
                 $message = "Включил категорию [" . $category->name . "]";
             } else {
                 $message = "Отключил категорию [" . $category->name . "]";
             }
             $label = 'Категории';
             $colorLabel = 'label label-success';
             break;
         case 'create_user':
             $message = "Создал пользователя [" . $object . "]";
             $label = 'Пользователи';
             $colorLabel = 'label';
             break;
         case 'update_user':
             $message = "Отредактировал пользователя(ей) [" . $object . "]";
             $label = 'Пользователи';
             $colorLabel = 'label';
             break;
         case 'status_user':
             $userModel = new User();
             $user = $userModel->getUser($object, array('showname'));
             if ($dop) {
                 $message = "Включил пользователя [" . $user->showname . "]";
             } else {
                 $message = "Отключил пользователя [" . $user->showname . "]";
             }
             $label = 'Пользователи';
             $colorLabel = 'label';
             break;
         case 'create_currency':
             $message = "Создал новую валюту [" . $object . "]";
             $label = 'Валюты';
             $colorLabel = 'label label-warning';
             break;
         case 'delete_currency':
             $currencyModel = new Currency();
             $currency = $currencyModel->getNameCurrencyById($object);
             $message = "Удалил валюту [" . $currency . "]";
             $label = 'Валюты';
             $colorLabel = 'label label-warning';
             break;
         case 'update_rate':
             $currencyModel = new Currency();
             $currency = $currencyModel->getNameCurrencyById($object['currency_id']);
             $message = "Установил курс [" . $currency . " = " . $object['rate'] . "]";
             $label = 'Валюты';
             $colorLabel = 'label label-warning';
             break;
         case 'auto_update_currency':
             $this->insert(array('label' => "Валюты", 'color_label' => 'label label-warning', 'action' => "Обновлены курсы валют по ЦБ", 'user_id' => $object, 'created_at' => date('Y-m-d H:i:s')));
             return true;
             break;
         case 'create_note':
             $message = "Создал публичную заметку";
             $label = 'Заметки';
             $colorLabel = 'label';
             break;
         case 'update_products':
             $product = array();
             foreach ($object as $key => $elem) {
                 $product[] = "<a class='h_def' href='/product/" . $key . "'>" . $key . "</a>";
             }
             $message = "Отредактировал товар(ы) [" . implode(', ', $product) . "]";
             $label = 'Товары и цены';
             $colorLabel = 'label label-primary';
             break;
         case 'import':
             $text = '';
             if (isset($object['update_prod'])) {
                 $text .= "[" . plural_form($object['update_prod'], 'обновлен', false) . ' ' . plural_form($object['update_prod'], 'товар') . "] ";
             }
             if (isset($object['add_prod'])) {
                 $text .= "[" . plural_form($object['add_prod'], 'добавлен', false) . ' ' . plural_form($object['add_prod'], 'товар') . "] ";
             }
             if (isset($object['add_to_GK'])) {
                 $text .= "[на ГК " . plural_form($object['add_to_GK'], 'добавлен', false) . ' ' . plural_form($object['add_to_GK'], 'товар') . "] ";
             }
//.........这里部分代码省略.........
开发者ID:enotsokolov,项目名称:vp_plus,代码行数:101,代码来源:History.php


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