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


PHP Request::isPost方法代码示例

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


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

示例1: process

 public function process()
 {
     if (!$this->wizard || !$this->request->isPost()) {
         return;
     }
     $post = $this->request->getPost();
     $values = $post->getArrayCopy();
     if (isset($values['previous'])) {
         $this->wizard->previousStep();
         return;
     }
     if (isset($values['cancel'])) {
         return $this->doCancel();
     }
     $this->processCurrentStep($values);
     $steps = $this->wizard->getSteps();
     $currentStep = $this->wizard->getCurrentStep();
     if (!$currentStep->isComplete()) {
         return;
     }
     if ($currentStep->isComplete() && $steps->isLast($currentStep)) {
         return $this->completeWizard();
     }
     $this->wizard->nextStep();
 }
开发者ID:Tribalx,项目名称:Wizard,代码行数:25,代码来源:WizardProcessor.php

示例2: deleteAction

 public function deleteAction()
 {
     if ($this->request->isPost()) {
         if ($this->request->getPost('confirm') === 'oui') {
             $id = $this->params('id');
             $this->contactService->delete($id);
         }
         return $this->redirect()->toRoute('address-book-contact');
     }
     return $this->showAction();
 }
开发者ID:bioub,项目名称:Formation_ZF2_Adista_201602,代码行数:11,代码来源:ContactController.php

示例3: addAction

 public function addAction()
 {
     $form = $this->service->createForm();
     if ($this->request->isPost()) {
         $data = $this->request->getPost();
         if ($this->service->insert($data)) {
             return $this->redirect()->toRoute('contact');
         }
     }
     return new ViewModel(array('contactForm' => $form->prepare()));
 }
开发者ID:bioub,项目名称:Formation_ZF2_OBS_2015_10,代码行数:11,代码来源:ContactController.php

示例4: init

 public function init(Request $request)
 {
     if (!$request->isXmlHttpRequest() || !$request->isPost()) {
         $this->noAccess();
     }
     $this->post = $request->getPost();
 }
开发者ID:visinoiu,项目名称:WarehouseTask,代码行数:7,代码来源:AjaxLibrary.php

示例5: isSupported

 /**
  * Returns whether we are capable of creating a ModelRessource
  * @param string $resourceString
  * @param Request $request
  * @return bool
  */
 private function isSupported($resourceString, Request $request)
 {
     if ($resourceString && strpos($resourceString, 'Theodia\\V1\\Rest\\') === 0 && strpos($resourceString, '\\Controller::entity') !== false) {
         return true;
     } elseif ($request->isPost() && array_key_exists($resourceString, $this->mapping)) {
         return true;
     }
     return false;
 }
开发者ID:Theodia,项目名称:theodia.org,代码行数:15,代码来源:ResourceResolverListener.php

示例6: isCollection

 /**
  * Does the request represent a collection?
  *
  * @param string $serviceName
  * @param array $data
  * @param RouteMatch $matches
  * @param HttpRequest $request
  * @return bool
  */
 protected function isCollection($serviceName, $data, RouteMatch $matches, HttpRequest $request)
 {
     if (!array_key_exists($serviceName, $this->restControllers)) {
         return false;
     }
     if ($request->isPost() && (empty($data) || ArrayUtils::isHashTable($data))) {
         return false;
     }
     $identifierName = $this->restControllers[$serviceName];
     if ($matches->getParam($identifierName)) {
         return false;
     }
     return null === $request->getQuery($identifierName, null);
 }
开发者ID:alapini,项目名称:apigility-3hr-tutorial,代码行数:23,代码来源:ContentValidationListener.php

示例7: processFormRequest

 /**
  * @param Request       $request
  * @param FormInterface $form
  * @param Content       $content
  */
 private function processFormRequest(Request $request, FormInterface $form, Content $content)
 {
     if ($request->isPost()) {
         $data = array_merge_recursive($request->getPost()->toArray(), $request->getFiles()->toArray());
         $this->processFormData($form, $content, $data);
     }
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:12,代码来源:ContentController.php

示例8: getAction

 /**
  * Get REST action
  * 
  * @author Stoyan Rangelov
  * @param \Zend\Http\Request $request
  * @return string
  */
 public function getAction(\Zend\Http\Request $request)
 {
     if ($request->isGet()) {
         $explodedURI = explode('/', $request->getUriString());
         $lastElement = end($explodedURI);
         if ($lastElement != 0) {
             $action = 'get';
         } else {
             $action = 'getList';
         }
     } else {
         if ($request->isPost()) {
             $action = 'create';
         } else {
             if ($request->isPut()) {
                 $action = 'update';
             } else {
                 if ($request->isDelete()) {
                     $action = 'delete';
                 }
             }
         }
     }
     return $action;
 }
开发者ID:EngrHaiderAli,项目名称:incoverage-backend,代码行数:32,代码来源:Permission.php

示例9: isSubmitted

 /**
  * @inheritdoc
  */
 public function isSubmitted(Request $request)
 {
     return $request->isPost();
 }
开发者ID:digitaledgeit,项目名称:zf2-authentication-module,代码行数:7,代码来源:AbstractAuthentication.php


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