當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::post方法代碼示例

本文整理匯總了PHP中Slim\Http\Request::post方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::post方法的具體用法?PHP Request::post怎麽用?PHP Request::post使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Slim\Http\Request的用法示例。


在下文中一共展示了Request::post方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: configureAction

 /**
  * @Route /configuration/configure
  */
 public function configureAction(\Slim\Http\Request $request)
 {
     $parameters = array();
     $parameters['database'] = array();
     $parameters['database']['driver'] = $request->post('driver');
     $parameters['database']['dbname'] = '';
     $parameters['database']['user'] = $request->post('user');
     $parameters['database']['port'] = $request->post('port');
     $parameters['database']['password'] = $request->post('password');
     $parameters['database']['host'] = $request->post('host');
     $parameters['raptor'] = array();
     $parameters['raptor']['language'] = $request->post('lang');
     $parameters['raptor']['secret'] = $request->post('secret');
     $parameters['raptor']['cache'] = $request->post('cache');
     $this->app->getConfigurationLoader()->setConfOption($parameters);
     $this->getStore()->connect();
     $this->getStore()->generateDatabase($request->post('db'));
     $parameters['database']['dbname'] = $request->post('db');
     $this->app->getConfigurationLoader()->setConfOption($parameters);
     $this->app->getConfigurationLoader()->writeOptions();
     $this->app->getConfigurationLoader()->forceLoad();
     //        $parameters['database']['password'] = '???';
     //        $this->app->getConfigurationLoader()->setConfOption($parameters);
     //        $this->app->getConfigurationLoader()->writeOptions();
     return $this->render('@systemBundle/configure/parameter.html.twig');
 }
開發者ID:williamamed,項目名稱:Raptor2,代碼行數:29,代碼來源:ConfigureController.php

示例2: __construct

 /**
  * @param View $view
  * @param Request $request
  * @param UserRepository $userRepository
  * @param Session $session
  * @param Redirector $redir
  */
 public function __construct(View $view, Request $request, UserRepository $userRepository, Session $session, Redirector $redir)
 {
     $this->view = $view;
     $this->username = $request->post('username');
     $this->password = $request->post('password');
     $this->userRepository = $userRepository;
     $this->session = $session;
     $this->redir = $redir;
 }
開發者ID:pleonasm,項目名稱:bsg,代碼行數:16,代碼來源:LoginSubmit.php

示例3: __construct

 /**
  * @param Request $request
  * @param UserRepository $userRepository
  * @param Redirector $redirector
  */
 public function __construct(Request $request, UserRepository $userRepository, Redirector $redirector)
 {
     $this->dispname = $request->post('dispname');
     $this->username = $request->post('username');
     $this->password = $request->post('password');
     $this->phone = $request->post('phone');
     $this->userRepository = $userRepository;
     $this->redirector = $redirector;
 }
開發者ID:pleonasm,項目名稱:bsg,代碼行數:14,代碼來源:RegistrationSubmit.php

示例4: get

 public function get($name)
 {
     $value = $this->request->get($name);
     if ($value === null) {
         $value = $this->request->post($name);
     }
     if ($value === null) {
         $value = @$this->defaultValues[$name];
     }
     return $value;
 }
開發者ID:QualityUnit,項目名稱:swagger-codegen,代碼行數:11,代碼來源:Params.class.php

示例5: configureAction

 /**
  * Add your definition route and the name route[optional]
  *
  * @Route /configure/configure
  * 
  * 
  * @param \Slim\Http\Request $request
  * @param \Slim\Http\Response $response
  * @param \Slim\Route $route
  */
 public function configureAction($request, $response, $route)
 {
     $this->constructServiceFile();
     $wsdlGenerator = new PHPClass2WSDL('Raptor2\\ServiceBundle\\Soap\\Service', $request->post('uri'));
     $wsdlGenerator->generateWSDL(FALSE);
     $actual = $wsdlGenerator->dump();
     $dirClass = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Soap';
     file_put_contents($dirClass . DIRECTORY_SEPARATOR . 'wsdl' . DIRECTORY_SEPARATOR . 'service.wsdl', $actual);
     $this->app->getConfigurationLoader()->setConfOption(array('raptor' => array('services' => $request->post('uri'))));
     $this->app->getConfigurationLoader()->writeOptions();
     $this->app->getConfigurationLoader()->forceLoad();
     return $this->render('@ServiceBundle/configure/parameter.html.twig');
 }
開發者ID:williamamed,項目名稱:Raptor2,代碼行數:23,代碼來源:DefaultController.php

示例6: createBundleAction

 /**
  * @Route /genbundle/create
  * @param \Slim\Http\Request $request
  */
 public function createBundleAction($request)
 {
     $bundleName = $request->post('bundle');
     $bundleName .= 'Bundle';
     $messages = new ItemList();
     if (!$this->createBundleDirectory($request->post('vendor'), $bundleName, $messages)) {
         return $this->show("Sorry cannot create the Bundle directory", true, Controller::ERROR);
     }
     $this->createFiles($bundleName, $request->post('definition'), $request->post('vendor'), $messages);
     $this->app->getConfigurationLoader()->registerBundle($request->post('definition') . '\\' . $bundleName);
     $resp = array();
     $messages->each(function ($key, $value) use(&$resp) {
         $resp[] = array('msg' => $value);
     });
     $resp = array('response' => $resp);
     $this->app->getConfigurationLoader()->forceLoad();
     return $this->show("Bundle created", true, Controller::INFO, $resp);
 }
開發者ID:williamamed,項目名稱:Raptor2,代碼行數:22,代碼來源:BundleGeneratorController.php

示例7: __construct

 protected function __construct(\Slim\Http\Request $request)
 {
     $key = $request->headers('apikey');
     if ($key == '') {
         $key = $request->post('apikey');
     }
     if ($key == '') {
         $key = $request->get('apikey');
     }
     if ($key == '') {
         return;
     }
     $this->apiKey = $key;
     $this->role = $this->getRoleFromKey($this->apiKey);
 }
開發者ID:QualityUnit,項目名稱:swagger-codegen,代碼行數:15,代碼來源:Auth.class.php

示例8: extractToken

 public function extractToken(Request $request)
 {
     $tokenHeader = $request->headers('Authorization', false);
     $rawTokenHeader = $request->rawHeaders('Authorization', false);
     if ($tokenHeader && preg_match('/Bearer\\s*([^\\s]+)/', $tokenHeader, $matches)) {
         $tokenHeader = $matches[1];
     } elseif ($rawTokenHeader && preg_match('/Bearer\\s*([^\\s]+)/', $rawTokenHeader, $matches)) {
         $tokenHeader = $matches[1];
     } else {
         $tokenHeader = false;
     }
     $tokenRequest = $request->post('access_token', false);
     $tokenQuery = $request->get('access_token', false);
     // At least one (and only one) of client credentials method required.
     if (!$tokenHeader && !$tokenRequest && !$tokenQuery) {
         throw new Exception('The request is missing a required parameter.', Resource::STATUS_BAD_REQUEST);
     } elseif ($tokenHeader && $tokenRequest || $tokenRequest && $tokenQuery || $tokenQuery && $tokenHeader) {
         throw new Exception('The request includes multiple credentials.', Resource::STATUS_BAD_REQUEST);
     }
     $accessToken = $tokenHeader ?: $tokenRequest ?: $tokenQuery;
     try {
         $tokenDocument = $this->fetchToken($accessToken);
     } catch (\Exception $e) {
         throw new Exception('Access token invalid.');
     }
     return $tokenDocument;
 }
開發者ID:rohanabraham,項目名稱:lxHive,代碼行數:27,代碼來源:OAuth.php

示例9: __invoke

 public function __invoke()
 {
     $title = $this->request->post('gamename');
     $this->gameRepository->createGameUnsafe($title, $this->currentUser);
     $this->redirector->redirect(303, '/games');
 }
開發者ID:pleonasm,項目名稱:bsg,代碼行數:6,代碼來源:GamesCreatePageSubmit.php

示例10: getSlimView

 public function getSlimView(\Slim\Http\Request $request)
 {
     if ($request->isAjax() || $request->isXhr() || $request->get('format', '') == 'json' || $request->post('format', '') == 'json') {
         return $this->slimViewFactory->getJsonSlimView();
     }
     return $this->slimViewFactory->getHtmlSlimView();
 }
開發者ID:anneks,項目名稱:rightaboutnow,代碼行數:7,代碼來源:SlimViewPicker.class.php


注:本文中的Slim\Http\Request::post方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。