当前位置: 首页>>代码示例>>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;未经允许,请勿转载。