本文整理汇总了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();
}
示例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();
}
示例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()));
}
示例4: init
public function init(Request $request)
{
if (!$request->isXmlHttpRequest() || !$request->isPost()) {
$this->noAccess();
}
$this->post = $request->getPost();
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
示例9: isSubmitted
/**
* @inheritdoc
*/
public function isSubmitted(Request $request)
{
return $request->isPost();
}