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


PHP Zend_Controller_Request_Http::getQuery方法代码示例

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


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

示例1: matchForwardShort

 /**
  * @return bool
  */
 protected function matchForwardShort()
 {
     $pageId = $this->request->getPathInfo();
     $pageId = $this->getUrlHelper()->checkRemoveSuffix($pageId);
     $pageId = trim($pageId, '/');
     $p = strrpos($pageId, '/');
     if ($p) {
         $cat = substr($pageId, 0, $p);
         $params = substr($pageId, $p);
     } else {
         $cat = '';
         $params = $pageId;
     }
     /** @var Amasty_Shopby_Model_Url_Parser $shortParser */
     $shortParser = Mage::getModel('amshopby/url_parser');
     $query = $shortParser->parseParams($params);
     if ($query === false) {
         return false;
     }
     $query = array_merge($this->request->getQuery(), $query);
     $this->request->setQuery($query);
     if (strlen($cat)) {
         // normal category
         try {
             $this->forwardCategory($cat);
         } catch (Mage_Core_Controller_Varien_Exception $e) {
             return false;
         }
     } else {
         // root category
         $this->forwardShopby();
     }
     return true;
 }
开发者ID:xiaoguizhidao,项目名称:tyler-live,代码行数:37,代码来源:Router.php

示例2: matchForwardShort

 /**
  * @return bool
  */
 protected function matchForwardShort()
 {
     $pageId = $this->request->getPathInfo();
     $pageId = $this->getUrlHelper()->checkRemoveSuffix($pageId);
     $pageId = trim($pageId, '/');
     $p = strrpos($pageId, '/');
     if ($p) {
         $cat = substr($pageId, 0, $p);
         $params = substr($pageId, $p);
     } else {
         $cat = '';
         $params = $pageId;
     }
     /** @var Amasty_Shopby_Model_Url_Parser $shortParser */
     $shortParser = Mage::getModel('amshopby/url_parser');
     $queryDelta = $shortParser->parseParams($params);
     if (is_array($queryDelta)) {
         $query = $this->request->getQuery();
         $query = array_merge($query, $queryDelta);
         $this->request->setQuery($query);
         if (strlen($cat)) {
             // normal category
             $result = $this->forwardCategory($cat);
         } else {
             // root category
             $this->forwardShopby();
             $result = true;
         }
         return $result;
     }
     return false;
 }
开发者ID:victorkho,项目名称:telor,代码行数:35,代码来源:Router.php

示例3: getRequestParameters

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

示例4: testSetRequestUri

 public function testSetRequestUri()
 {
     $this->_request->setRequestUri('/archives/past/4?set=this&unset=that');
     $this->assertEquals('/archives/past/4?set=this&unset=that', $this->_request->getRequestUri());
     $this->assertEquals('this', $this->_request->getQuery('set'));
     $this->assertEquals('that', $this->_request->getQuery('unset'));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:7,代码来源:HttpTest.php

示例5: _rewriteDb

 /**
  * Implement logic of custom rewrites
  *
  * @return bool
  */
 protected function _rewriteDb()
 {
     if (null === $this->_rewrite->getStoreId() || false === $this->_rewrite->getStoreId()) {
         $this->_rewrite->setStoreId($this->_app->getStore()->getId());
     }
     $requestCases = $this->_getRequestCases();
     $this->_rewrite->loadByRequestPath($requestCases);
     $fromStore = $this->_request->getQuery('___from_store');
     if (!$this->_rewrite->getId() && $fromStore) {
         $stores = $this->_app->getStores(false, true);
         if (!empty($stores[$fromStore])) {
             /** @var $store Mage_Core_Model_Store */
             $store = $stores[$fromStore];
             $fromStoreId = $store->getId();
         } else {
             return false;
         }
         $this->_rewrite->setStoreId($fromStoreId)->loadByRequestPath($requestCases);
         if (!$this->_rewrite->getId()) {
             return false;
         }
         // Load rewrite by id_path
         $currentStore = $this->_app->getStore();
         $this->_rewrite->setStoreId($currentStore->getId())->loadByIdPath($this->_rewrite->getIdPath());
         $this->_setStoreCodeCookie($currentStore->getCode());
         $targetUrl = $currentStore->getBaseUrl() . $this->_rewrite->getRequestPath();
         $this->_sendRedirectHeaders($targetUrl, true);
     }
     if (!$this->_rewrite->getId()) {
         return false;
     }
     $this->_request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $this->_rewrite->getRequestPath());
     $this->_processRedirectOptions();
     return true;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:40,代码来源:Request.php

示例6: getPaginator

 /**
  * Возвращает массив опций для построения постраничной навигации
  * Необходимо дергать сразу после выполнения SQL-запроса с SQL_CAL_FOUND_ROWS
  * 
  * @param array $options - Массив опций
  * 
  * @return object
  */
 function getPaginator($options = array())
 {
     $Paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Null($this->_db->fetchOne('SELECT FOUND_ROWS()')));
     $Paginator->setItemCountPerPage(isset($options['perpage']) ? $options['perpage'] : $this->getPerPage());
     if (isset($options['widgetid'])) {
         $Paginator->setCurrentPageNumber($this->getCurrentPage($options['widgetid']));
     } else {
         $Paginator->setCurrentPageNumber($this->getCurrentPage());
     }
     $out = $Paginator->getPages();
     $pageidentity = $this->getPageIdentity();
     // Кроме стандартных параметров Zend_Paginator::getPages() возвращаем доп. параметры
     // Полный путь без GET-запроса
     $UrlInfo = parse_url($this->_request->getRequestUri());
     $out->ClearUrl = $UrlInfo['path'];
     // Обрабатываем GET-запрос
     $query = $this->_request->getQuery();
     if (isset($query[$pageidentity])) {
         unset($query[$pageidentity]);
     }
     if (isset($query['widget'])) {
         unset($query['widget']);
     }
     // Строим строку выражения
     if (!empty($query)) {
         $out->Query = http_build_query($query);
     }
     // Фактически, ссылку на первую страницу (без page и widget)
     $out->FullUrl = isset($out->Query) ? $out->ClearUrl . '?' . $out->Query : $out->ClearUrl;
     // Добавляем к выражению Id виджета
     $widget = isset($options['widgetid']) ? 'widget=' . (int) $options['widgetid'] . '&' : '';
     // Полную ссылку к которой в конце надо только добавить номер страницы
     $out->PageUrl = isset($out->Query) ? $out->FullUrl . '&' . $widget . $pageidentity . '=' : $out->FullUrl . '?' . $widget . $pageidentity . '=';
     return $out;
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:43,代码来源:Model.php

示例7: getQuery

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

示例8: getRedirectUrl

 /**
  * Redirect to startup page after logging in if request contains any params (except security key)
  *
  * @param Mage_Admin_Model_User $user
  * @param Zend_Controller_Request_Http $request
  * @param string|null $alternativeUrl
  * @return null|string
  */
 public function getRedirectUrl(Mage_Admin_Model_User $user, Zend_Controller_Request_Http $request = null, $alternativeUrl = null)
 {
     if (empty($request)) {
         return;
     }
     $countRequiredParams = $this->_urlModel->useSecretKey() && $request->getParam(Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME) ? 1 : 0;
     $countGetParams = count($request->getUserParams()) + count($request->getQuery());
     return $countGetParams > $countRequiredParams ? $this->_urlModel->getUrl($user->getStartupPageUrl()) : $alternativeUrl;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:17,代码来源:Redirectpolicy.php

示例9: canProcessRequest

 /**
  * Do basic validation for request to be cached
  *
  * @param Zend_Controller_Request_Http $request
  * @return bool
  */
 public function canProcessRequest(Zend_Controller_Request_Http $request)
 {
     $res = $this->isAllowed();
     $res = $res && Mage::app()->useCache('full_page');
     if ($request->getParam('no_cache')) {
         $res = false;
     }
     if ($res) {
         $maxDepth = Mage::getStoreConfig(self::XML_PATH_ALLOWED_DEPTH);
         $queryParams = $request->getQuery();
         unset($queryParams[Enterprise_PageCache_Model_Cache::REQUEST_MESSAGE_GET_PARAM]);
         $res = count($queryParams) <= $maxDepth;
     }
     if ($res) {
         $multicurrency = Mage::getStoreConfig(self::XML_PATH_CACHE_MULTICURRENCY);
         if (!$multicurrency && !empty($_COOKIE['currency'])) {
             $res = false;
         }
     }
     return $res;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:27,代码来源:Processor.php

示例10: _getRequestParamsString

 /**
  * 
  * @param Zend_Controller_Request_Http $request
  * @return string
  */
 protected function _getRequestParamsString(Zend_Controller_Request_Http $request)
 {
     $allRequestParameters = $request->getQuery();
     return count($allRequestParameters) ? http_build_query($allRequestParameters) : '';
 }
开发者ID:styladev,项目名称:magentoStylaConnect,代码行数:10,代码来源:Router.php

示例11: _fetchProtocolParamsFromQuery

 /**
  * Retrieve protocol parameters from query string
  *
  * @return Mage_Oauth_Model_Server
  */
 protected function _fetchProtocolParamsFromQuery()
 {
     foreach ($this->_request->getQuery() as $queryParamName => $queryParamValue) {
         if ($this->_isProtocolParameter($queryParamName)) {
             $this->_protocolParams[$queryParamName] = $queryParamValue;
         }
     }
     return $this;
 }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例12: getCurrentPage

 /**
  * 获取当前页页码
  *
  * @return integer
  */
 public function getCurrentPage()
 {
     if (null === $this->_currentPage) {
         $request = new Zend_Controller_Request_Http();
         $currentPage = $request->getQuery($this->getUriSegment());
         $this->setCurrentPage($currentPage);
     }
     return $this->_currentPage;
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:14,代码来源:Paginator.php

示例13: buildUrl

 /**
  * Builds a new URL using an existing $request.
  *
  * @param string $scheme http or https
  * @param string $hostname
  * @param string $baseUrl
  * @param Zend_Controller_Request_Http $request
  * @return string
  */
 private function buildUrl($scheme, $hostname, $baseUrl, Zend_Controller_Request_Http $request)
 {
     $url = sprintf('%s://%s%s%s', $scheme, $hostname, $baseUrl, $request->getPathInfo());
     $query = $request->getQuery();
     if (!empty($query)) {
         $url .= '?' . http_build_query($query);
     }
     return $url;
 }
开发者ID:ClaudioThomas,项目名称:shopware-4,代码行数:18,代码来源:Bootstrap.php

示例14: getQuery

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


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