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


PHP Zend_Controller_Request_Http::getPost方法代码示例

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


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

示例1: getRequestParameters

 public function getRequestParameters()
 {
     if ($this->request->isPost()) {
         return $this->request->getPost();
     } else {
         return $this->request->getQuery();
     }
 }
开发者ID:simgroep,项目名称:oauth1-service,代码行数:8,代码来源:Zf1Request.php

示例2: addAction

 public function addAction()
 {
     $form = new Front_Form_Contact();
     if ($this->_request->isPost()) {
         $data = $this->_request->getPost();
         if ($form->isValid($data)) {
             $dataFiltrees = $form->getValues();
             $contact = new Application_Model_Contact();
             $contact->setPrenom($dataFiltrees['prenom'])->setNom($dataFiltrees['nom'])->setEmail($dataFiltrees['email'])->setTelephone($dataFiltrees['telephone']);
             $this->mapper->insert($contact);
             $this->_flashMessenger->addMessage('Le contact ' . $contact->getPrenom() . ' a bien été créé');
             $this->_redirector->gotoRouteAndExit(['controller' => 'contact'], null, true);
         }
     }
     $this->view->contactForm = $form;
 }
开发者ID:bioub,项目名称:Formation_ZF1_Viveris_2016_02,代码行数:16,代码来源:ContactController.php

示例3: getPost

 /**
  * @access public
  * @param  string  $key     Key to search for in $_POST
  * @param  mixed   $default Default value if $key is not found $_POST
  * @param  integer $filter  Filter definition
  * @param  array   $options Filter configuration
  * @return mixed
  */
 public function getPost($key = null, $default = null, $filter = null, array $options = null)
 {
     $value = parent::getPost($key, $default);
     if ($filter !== null || $options !== null) {
         $value = $this->_filter($value, $default, $filter, $options);
     }
     return $value;
 }
开发者ID:bergelmir,项目名称:Idun,代码行数:16,代码来源:Http.php

示例4: testGetPost

 public function testGetPost()
 {
     $_POST['post1'] = 'val1';
     $this->assertEquals('val1', $this->_request->getPost('post1'));
     $this->assertEquals('foo', $this->_request->getPost('BAR', 'foo'));
     $_POST['post2'] = 'val2';
     $expected = array('post1' => 'val1', 'post2' => 'val2');
     $this->assertEquals($expected, $this->_request->getPost());
 }
开发者ID:nbcutech,项目名称:o3drupal,代码行数:9,代码来源:HttpTest.php

示例5: getPost

 public function getPost($k = null, $default = null)
 {
     if (in_array('vars', $this->getParamSources())) {
         if (!$this->isPost()) {
             return $k === null ? array() : null;
         }
         if ($k === null) {
             return $this->_vars;
         } else {
             return isset($this->_vars[$k]) ? $this->_vars[$k] : $default;
         }
     }
     return parent::getPost($k, $default);
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:14,代码来源:Request.php

示例6: widget

 /**
  * Implements {@link iPMS_Widget_Interface::widget()}
  *
  * @param Zend_Controller_Request_Http $request
  * @return Zend_Form|null A Zend_Form instance or null if user is already authenticated
  */
 public function widget(Zend_Controller_Request_Http $request)
 {
     $auh = Zend_Auth::getInstance();
     if (!$auh->hasIdentity()) {
         $form = $this->getForm('loginForm');
         if ($request->isPost() && is_array($request->getPost('loginForm')) && $form->isValid($request->getPost('loginForm'))) {
             $authDbAdapter = new Zend_Auth_Adapter_DbTable(null, 'users', 'username', 'password', 'MD5(?) AND active = 1');
             $authDbAdapter->setIdentity($form->getValue('username'))->setCredential($form->getValue('password'));
             $result = $authDbAdapter->authenticate();
             if ($result->isValid()) {
                 $auh->getStorage()->write($authDbAdapter->getResultRowObject(null, 'password'));
                 Zend_Session::regenerateId();
                 // Protection against session's fixation attacks
                 /**
                  * @var $redirector Zend_Controller_Action_Helper_Redirector
                  */
                 $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
                 $redirector->gotoUrl('/');
             }
         }
         return $form;
     }
     return null;
 }
开发者ID:nuxwin,项目名称:i-PMS,代码行数:30,代码来源:Login.php

示例7: match

 /**
  * Rewritten function of the standard controller. Tries to match the pathinfo on url parameters.
  *
  * @see Mage_Core_Controller_Varien_Router_Standard::match()
  *
  * @param Zend_Controller_Request_Http $request The http request object that needs to be mapped on Action
  *                                              Controllers.
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $identifier = trim($request->getPathInfo(), '/');
     //URL Search after habbeda
     $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     //$identifier = trim($request->getPathInfo(), '/');
     if (strpos($url, "/alle/") <= 0 && strpos($url, "/all/") <= 0) {
         return false;
     }
     // if successfully gained url parameters, use them and dispatch ActionController action
     $request->setRouteName('landingpagesaa')->setModuleName('landingpagesaa')->setControllerName('index')->setActionName('index');
     //->setParam('test', "test");
     $urlpara = explode("/filter/", $url);
     if (!empty($urlpara[1])) {
         $urlparas = explode("?", $urlpara[1]);
         // Parse url params
         $params = explode('/', trim($urlparas[0], '/'));
         $layerParams = array();
         $total = count($params);
         for ($i = 0; $i < $total - 1; $i++) {
             if (isset($params[$i + 1])) {
                 $layerParams[$params[$i]] = urldecode($params[$i + 1]);
                 ++$i;
             }
         }
         // Add post params to parsed ones from url
         // Usefull to easily override params
         $layerParams += $request->getPost();
         // Add params to request
         $request->setParams($layerParams);
         // Save params in registry - used later to generate links
         Mage::register('layer_params', $layerParams);
     }
     $request->setRequestUri($url);
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return true;
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:49,代码来源:Router.php

示例8: editAction

 public function editAction()
 {
     $itemId = $this->_request->getParam('id');
     if (is_null($itemId)) {
         $this->getRedirector()->gotoSimpleAndExit('index');
     }
     $page = $this->getModelMapper()->find($itemId, $this->getModel());
     if (is_null($page)) {
         throw new Zend_Controller_Action_Exception("Страница не найдена", 404);
     }
     //$this->view->item = $page;
     $form = $this->getForm('edit');
     $form->addElement('hidden', 'currentUrl');
     $element = $form->getElement('currentUrl');
     $element->setValue($this->_hostHttp->getServer('REQUEST_URI'));
     $form->getDisplayGroup('basic')->addElement($element);
     $dataPage = $page->getOptions();
     foreach ($dataPage as $key => $value) {
         $form->setDefault($key, $value);
     }
     foreach ($form->getElements() as $key => $element) {
         if ($element instanceof Zend_Form_Element_Image) {
             $imageValue = $form->getValue($element->getAttrib('data-input')) != '' ? $form->getValue($element->getAttrib('data-input')) : '/files/images/product/2012-05-22_foto_nv.jpg';
             $form->setDefault($element->getName(), $imageValue);
         }
     }
     if ($this->_hostHttp->isPost()) {
         if ($form->isValid($this->_hostHttp->getPost())) {
             $this->saveFormData($form);
             $this->clearCache($this->_getNamespace());
             $this->getRedirector()->gotoUrlAndExit($this->_request->getParam('currentUrl'));
         }
         $form->setDefaults($form->getValues());
     }
     $colsTable = $this->getModelMapper()->getDbTable()->info('cols');
     $uri = in_array('full_path', $colsTable) ? $page->getFullPath() : $page->getPath();
     $config = array(Zend_Navigation_Page_Mvc::factory(array('label' => 'На сайт', 'uri' => '/' . strtolower($this->getNameModule()) . '/' . $uri . '/')));
     $containerNav = new Zend_Navigation($config);
     $this->view->assign(array('item' => $page, 'form' => $form, 'container_nav' => $containerNav));
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:40,代码来源:BaseController.php

示例9: _checkBaseUrl

 /**
  * Auto-redirect to base url (without SID) if the requested url doesn't match it.
  * By default this feature is enabled in configuration.
  *
  * @param Zend_Controller_Request_Http $request
  */
 protected function _checkBaseUrl($request)
 {
     if (!Mage::isInstalled() || $request->getPost()) {
         return;
     }
     if (!Mage::getStoreConfig('web/url/redirect_to_base')) {
         return;
     }
     $adminPath = (string) Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH);
     if (!$adminPath) {
         $adminPath = (string) Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME);
     }
     if (preg_match('#^' . $adminPath . '(\\/.*)?$#', ltrim($request->getPathInfo(), '/')) && (string) Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_URL)) {
         return;
     }
     $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, Mage::app()->getStore()->isCurrentlySecure());
     if (!$baseUrl) {
         return;
     }
     $redirectCode = 302;
     if (Mage::getStoreConfig('web/url/redirect_to_base') == 301) {
         $redirectCode = 301;
     }
     $uri = @parse_url($baseUrl);
     $host = isset($uri['host']) ? $uri['host'] : '';
     $path = isset($uri['path']) ? $uri['path'] : '';
     $requestUri = $request->getRequestUri() ? $request->getRequestUri() : '/';
     if ($host && $host != $request->getHttpHost() || $path && strpos($requestUri, $path) === false) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($baseUrl, $redirectCode)->sendResponse();
         exit;
     }
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:38,代码来源:Front.php

示例10: _checkBaseUrl

 /**
  * Auto-redirect to base url (without SID) if the requested url doesn't match it.
  * By default this feature is enabled in configuration.
  *
  * @param Zend_Controller_Request_Http $request
  */
 protected function _checkBaseUrl($request)
 {
     if (!Mage::isInstalled() || $request->getPost()) {
         return;
     }
     if (!Mage::getStoreConfig('web/url/redirect_to_base')) {
         return;
     }
     $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, Mage::app()->getStore()->isCurrentlySecure());
     if (!$baseUrl) {
         return;
     }
     $redirectCode = 302;
     if (Mage::getStoreConfig('web/url/redirect_to_base') == 301) {
         $redirectCode = 301;
     }
     $uri = @parse_url($baseUrl);
     $host = isset($uri['host']) ? $uri['host'] : '';
     $path = isset($uri['path']) ? $uri['path'] : '';
     $requestUri = $request->getRequestUri() ? $request->getRequestUri() : '/';
     if ($host && $host != $request->getHttpHost() || $path && strpos($requestUri, $path) === false) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($baseUrl, $redirectCode)->sendResponse();
         exit;
     }
 }
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:31,代码来源:Front.php

示例11: getRawPost

 public function getRawPost($key = null, $default = null)
 {
     return parent::getPost($key = null, $default = null);
 }
开发者ID:sasezaki,项目名称:zf-exts,代码行数:4,代码来源:Http.php

示例12: setFilterData

 /**
  * Ustawia wartosci filtrow
  *
  * Jezeli dostarczono parametry filtrow poprzez POST, zostaja one walidowane
  * poprzez formularz. Jezeli nie bedzie bledow, dane zostana zapisane
  * w tablicy filtrow oraz przekazane do formularza filtrow.
  *
  * @param Zend_Controller_Request_Http $request
  * @throws Logic_Search_Exception
  * @return Logic_Search_Abstract
  */
 public function setFilterData(Zend_Controller_Request_Http $request)
 {
     if (!is_object($this->_form)) {
         throw new Logic_Search_Exception('Nie ustanowiono obiektu formularza filtrow');
     }
     $values = $request->getPost();
     unset($values['ids']);
     if (!empty($values)) {
         if ($this->_form->isValid($values)) {
             $this->saveFilterData($this->_form->getValues());
         }
     }
     $this->_form->setDefaults($this->getFilterData());
     return $this;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:26,代码来源:Abstract.php

示例13: _checkShouldBeSecure

 /**
  * Check that request uses https protocol if it should.
  * Function redirects user to correct URL if needed.
  *
  * @param Zend_Controller_Request_Http $request
  * @param string $path
  * @return void
  */
 protected function _checkShouldBeSecure(Zend_Controller_Request_Http $request, $path = '')
 {
     if (!Mage::isInstalled() || $request->getPost()) {
         return;
     }
     if ($this->_shouldBeSecure($path) && !$request->isSecure()) {
         $url = $this->_getCurrentSecureUrl($request);
         if ($this->_shouldRedirectToSecure()) {
             $url = Mage::getSingleton('Mage_Core_Model_Url')->getRedirectUrl($url);
         }
         Mage::app()->getFrontController()->getResponse()->setRedirect($url)->sendResponse();
         exit;
     }
 }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例14: __saveEmployee

 /**
  * 
  * @param \Zend_Controller_Request_Http $request
  * @return booloean
  */
 private function __saveEmployee($request)
 {
     $employee = new Employee_Model_Employee($request->getPost());
     $empoyeeMapper = new Employee_Model_EmployeeMapper();
     return $empoyeeMapper->save($employee);
 }
开发者ID:NgoDucHai,项目名称:Student,代码行数:11,代码来源:ProfileController.php

示例15: _mergeValue

 /**
  * Merge session value and post value
  *
  * @param  array $names Value to merge
  * @param  mixed $namespace Session namespace
  * @access protected
  * @return array Merged param value
  */
 protected function _mergeValue(array $names, $namespace)
 {
     $session = new Zend_Session_Namespace($namespace);
     $params = array();
     foreach ($names as $key => $val) {
         $params[$val] = $this->_request->getPost($val);
     }
     if (isset($session->params)) {
         $params = array_merge($session->params, $params);
     }
     return $params;
 }
开发者ID:heavenshell,项目名称:gene,代码行数:20,代码来源:Abstract.php


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