• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP request类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: updateDepartmentAction

 public function updateDepartmentAction(request $request)
 {
     // Get the ID variable from the request
     $id = $request->get('id');
     // Create a new Department entity
     $department = new Department();
     $em = $this->getDoctrine()->getManager();
     // Find a department by the ID sent in by the request
     $department = $em->getRepository('AppBundle:Department')->find($id);
     // Only edit if it is a SUPER_ADMIN
     if ($this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
         // Create the form
         $form = $this->createForm(new CreateDepartmentType(), $department);
         // Handle the form
         $form->handleRequest($request);
         if ($form->isValid()) {
             $em->persist($department);
             $em->flush();
             return $this->redirect($this->generateUrl('departmentadmin_show'));
         }
         return $this->render('department_admin/create_department.html.twig', array('department' => $department, 'form' => $form->createView()));
     } else {
         return $this->redirect($this->generateUrl('departmentadmin_show'));
     }
 }
开发者ID:vegardbb,项目名称:webpage,代码行数:25,代码来源:DepartmentController.php


示例2: update

 public function update($id, request $request)
 {
     $apikeys = ApiKeys::find($id);
     $apikeys->imei = $request->input('imei');
     $apikeys->save();
     return redirect()->intended('clients');
 }
开发者ID:abangrephol,项目名称:hairstyle-server,代码行数:7,代码来源:ClientsController.php


示例3: Process

 /**
  * Initiate the dispacther processes
  * 
  * @param request
  */
 public function Process(request $request)
 {
     $request->Process();
     // init this
     $this->Initiate();
     // create new controller
     $c = $request->controller->GetInstance();
     // set request as a property in controller
     $c->request = $request;
     // set view object
     $c->view = new \zinux\kernel\view\baseView($request);
     // set layout object
     $c->layout = new \zinux\kernel\layout\baseLayout($c->view);
     $c->view->layout = $c->layout;
     // init controller
     $c->Initiate();
     // call the action method
     $c->request->action->InvokeAction($c);
     // render : layout ~> view
     $c->layout->Render();
     // dispose controller
     $c->Dispose();
     // dispose this
     $this->Dispose();
 }
开发者ID:dariushha,项目名称:zinux,代码行数:30,代码来源:dispatcher.php


示例4: upload

 public function upload(request $request)
 {
     // getting all of the post data
     $file = $request->file('file');
     // setting up rules
     // $rules = array('image' => 'required',); //mimes:jpeg,bmp,png and for max size max:10000
     // doing the validation, passing post data, rules and the messages
     // $validator = Validator::make($file, $rules);
     //if ($validator->fails()) {
     // send back to the page with the input data and errors
     // return Redirect::to('upload')->withInput()->withErrors($validator);
     //}
     //else {
     // checking file is valid.
     if ($file->isValid()) {
         $destinationPath = 'assets/img/spelers';
         // upload path
         $extension = $file->getClientOriginalExtension();
         // getting image extension
         $fileName = $file->getClientOriginalName();
         //.'.'.$extension ; //rand(11111,99999).'.'.$extension; // renameing image
         $file->move($destinationPath, $fileName);
         // uploading file to given path
         // sending back with message
         //Session::flash('success', 'Upload successfully');
         //return Redirect::to('upload');
     }
     /*else {
         // sending back with error message.
         Session::flash('error', 'uploaded file is not valid');
         return Redirect::to('upload');
       }*/
     //  }
 }
开发者ID:KOVV,项目名称:datavolley,代码行数:34,代码来源:HomeController.php


示例5: validateMerchantOtp

 public function validateMerchantOtp(request $request)
 {
     $apiKey = $request->only('api_key');
     $validator = Validator::make($apiKey, ['api_key' => 'required']);
     if ($validator->fails()) {
         $response = response()->json(['response_code' => 'ERR_IAK', 'messages' => 'Invalid Api Key'], 403);
         return $response;
     }
     $role = Role::find(2);
     $key = Config::get('custom.JWTkey');
     $decoded = JWT::decode($apiKey['api_key'], $key, array('HS256'));
     if ($decoded->type != 'merchant') {
         return $response = response()->json(['response_code' => 'ERR_IAK', 'messages' => 'Invalid Api Key'], 403);
     }
     $user = User::find($decoded->sub);
     // check the current user
     if (empty($user) || !$user->hasRole(['merchant']) || !$user->status) {
         return $response = response()->json(['response_code' => 'ERR_IAK', 'messages' => 'Invalid Api Key'], 403);
     }
     $user_id = $user->id;
     $input = $request->only('otp');
     $matchThese = ['user_id' => $user_id, 'code' => $input['otp']];
     $sms = UserSmsCode::where($matchThese)->first();
     if ($sms == '' || empty($sms)) {
         return response()->json(['response_code' => 'RES_IOG', 'messages' => 'Invalid OTP Given'], 422);
     }
     $sms->status = true;
     $sms->save();
     $user->is_mobile_verified = true;
     $user->save();
     return response()->json(['response_code' => 'RES_MV', 'messages' => 'Mobile Verified']);
 }
开发者ID:abhilash698,项目名称:projectK,代码行数:32,代码来源:ValidateMobileController.php


示例6: load

 /**
  * @return array
  */
 public function load()
 {
     $request = new request(self::teams_steam_url, array('start_at_team_id' => $this->get_team_id(), 'teams_requested' => $this->get_teams_requested()));
     $teams_info = $request->send();
     if (is_null($teams_info)) {
         return null;
     }
     $teams = array();
     if (isset($teams_info->teams)) {
         $teams_info = (array) $teams_info->teams;
         $teams_info = $teams_info['team'];
         foreach ($teams_info as $team_info) {
             $team_info = (array) $team_info;
             $team = new team();
             $fields = array_keys($team_info);
             foreach ($fields as $field) {
                 // I hope, that API-response will be changed and players_ids, leagues_ids will become arrays
                 if (preg_match('/^player_\\d+_account_id$/', $field)) {
                     $team->add_player_id($team_info[$field]);
                     continue;
                 }
                 if (preg_match('/^league_id_\\d+$/', $field)) {
                     $team->add_league_id($team_info[$field]);
                     continue;
                 }
                 $team->set($field, (string) $team_info[$field]);
             }
             $teams[$team->get('team_id')] = $team;
         }
         return $teams;
     }
 }
开发者ID:digomes,项目名称:dota2-api,代码行数:35,代码来源:class.teams_mapper_web.php


示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(request $request)
 {
     //
     $folder = $request->get('folder');
     $data = $this->manager->folderInfo($folder);
     return view('admin.upload.index', $data);
 }
开发者ID:edom-huang,项目名称:myBlog,代码行数:12,代码来源:UploadController.php


示例8: load

 /**
  * @return array
  */
 public function load()
 {
     $request = new request(self::steam_matches_url, $this->_get_data_array());
     $xml = $request->send();
     if (is_null($xml)) {
         return null;
     }
     $matches = array();
     if (isset($xml->matches)) {
         $this->_total_results = $xml->total_results;
         foreach ($xml->matches as $m_matches) {
             foreach ($m_matches as $m) {
                 $match = new match();
                 $match->set_array((array) $m);
                 foreach ($m->players as $players) {
                     foreach ($players as $player) {
                         $slot = new slot();
                         $slot->set_array((array) $player);
                         $match->add_slot($slot);
                     }
                 }
                 $matches[$match->get('match_id')] = $match;
             }
         }
     }
     return $matches;
 }
开发者ID:digomes,项目名称:dota2-api,代码行数:30,代码来源:class.matches_mapper_web.php


示例9: store

 /**
  * Store Emails for updates in the future
  *
  * @return Response
  */
 public function store(request $request)
 {
     $email = new Email();
     $email->email = $request->input('email');
     $email->save();
     return redirect()->back();
 }
开发者ID:amiridon,项目名称:hairgoblin,代码行数:12,代码来源:PagesController.php


示例10: __construct

 function __construct()
 {
     $request = new request();
     if ($request->checkReq()) {
         $this->bearer = $_SERVER['HTTP_BEARER'];
     }
 }
开发者ID:veegandhi,项目名称:Smartfarm,代码行数:7,代码来源:update.php


示例11: updatePoint

 public function updatePoint($id, request $request)
 {
     $hairstyles = hairstyles::find($id);
     $hairstyles->Xpoint = $request->input('Xpoint');
     $hairstyles->Ypoint = $request->input('Ypoint');
     $hairstyles->save();
     return redirect()->intended('hairstyles/edit/' . $id);
 }
开发者ID:jojoalmost,项目名称:hairstyle-server,代码行数:8,代码来源:HairstylesController.php


示例12: update

 public function update($id, request $request)
 {
     $categories = Categories::find($id);
     $categories->name = $request->input('name');
     $categories->description = $request->input('description');
     $categories->save();
     return redirect()->intended('categories');
 }
开发者ID:jojoalmost,项目名称:hairstyle-server,代码行数:8,代码来源:CategoriesController.php


示例13: load

 /**
  * @param int $ugcid
  * @return object | null
  */
 public function load($ugcid = null)
 {
     if (!is_null($ugcid)) {
         $this->_ugcid = $ugcid;
     }
     $request = new request(self::steam_ugc_url, array('appid' => 570, 'ugcid' => $this->_ugcid));
     return $request->send();
 }
开发者ID:digomes,项目名称:dota2-api,代码行数:12,代码来源:class.ugc_mapper_web.php


示例14: load

 public function load()
 {
     $request = new request(self::leagues_prize_pool_steam_url, array('leagueid' => $this->get_league_id()));
     $prize_pool = $request->send();
     if (is_null($prize_pool)) {
         return null;
     }
     return (array) $prize_pool;
 }
开发者ID:digomes,项目名称:dota2-api,代码行数:9,代码来源:class.league_prize_pool_mapper_web.php


示例15: indexAction

 public function indexAction(request $request)
 {
     $searchTerm = $request->query->get('q');
     $identifyRepository = $this->getDoctrine()->getRepository('URSearchBundle:Identify');
     $categories = $identifyRepository->findCategoryDistributionFor($searchTerm);
     $identifiers = $identifyRepository->findAllWithNameLike($searchTerm);
     $request->getSession()->set('last_search', $searchTerm);
     return $this->render('URSearchBundle:Default:search.html.twig', array('categories' => $categories, 'results' => $identifiers));
 }
开发者ID:aubelj,项目名称:srcLocal,代码行数:9,代码来源:DefaultController.php


示例16: __construct

 function __construct()
 {
     /*
     Checking request to the server and token values
     Setting headers for each request
     */
     $request = new request();
     $request->checkReq(true, true);
 }
开发者ID:veegandhi,项目名称:Smartfarm,代码行数:9,代码来源:admin.php


示例17: getRequestByVacancyId

 function getRequestByVacancyId()
 {
     $elmId = $_POST['elmId'];
     $this->load->model('Request');
     $request = new request();
     $array = $request->getAllRequestByVacancy($elmId);
     $data["requests"] = $array;
     return $data;
 }
开发者ID:khsushan,项目名称:hoyanna.lk,代码行数:9,代码来源:Request_Controller.php


示例18: updatesousFamilleAction

 public function updatesousFamilleAction(request $request, $idSousFamille)
 {
     $em = $this->getDoctrine()->getManager();
     $sousFamille = $em->getRepository('ICAdministrationBundle:SousFamille')->find($idSousFamille);
     $sousFamille->setNom($request->get('nom'));
     $em->persist($sousFamille);
     $em->flush();
     return $this->redirectToRoute('ic_administration_affichage_sous_famille');
 }
开发者ID:toko30,项目名称:GestStock,代码行数:9,代码来源:OptionController.php


示例19: login

 public function login(request $request)
 {
     $input = $request->all();
     if (Auth::attempt(['email' => $input['email'], 'password' => $input['password']])) {
         return Redirect::route('home');
     } else {
         return Redirect::route('home')->with('loginFail', ['fail']);
     }
 }
开发者ID:jimpeeters,项目名称:Landoretti-JimPeeters,代码行数:9,代码来源:AuthController.php


示例20: showPost

 public function showPost($slug, request $request)
 {
     $post = Post::whereSlug($slug)->firstOrFail();
     $tag = $request->get('tag');
     if ($tag) {
         $tag = Tag::whereTag($tag)->firstOrFail();
     }
     return view($post->layout, compact('post', 'tag', 'slug'));
 }
开发者ID:edom-huang,项目名称:myBlog,代码行数:9,代码来源:BlogController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP requestUtils类代码示例发布时间:2022-05-23
下一篇:
PHP repository类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap