本文整理汇总了PHP中Mage_Core_Controller_Request_Http::getQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Request_Http::getQuery方法的具体用法?PHP Mage_Core_Controller_Request_Http::getQuery怎么用?PHP Mage_Core_Controller_Request_Http::getQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Controller_Request_Http
的用法示例。
在下文中一共展示了Mage_Core_Controller_Request_Http::getQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSearchQuery
/**
* @param Mage_Core_Controller_Request_Http $request
*
* @return string $query
*/
private function getSearchQuery(Mage_Core_Controller_Request_Http $request)
{
$maxQueryLength = (int) Mage::getStoreConfig('catalog/search/max_query_length') > 0 ? (int) Mage::getStoreConfig('catalog/search/max_query_length') : 128;
$query = preg_replace('/(\\W|html|php)+/', ' ', $request->getRequestString());
if (count($request->getQuery()) > 0) {
$query .= implode(' ', $request->getQuery());
}
return substr($query, 0, $maxQueryLength);
}
示例2: getQueryParams
/**
* @return array
*/
public function getQueryParams()
{
if (is_null($this->_queryParams)) {
$query = $this->_request->getQuery();
foreach ($this->_clearParams as $param) {
if (array_key_exists($param, $query)) {
unset($query[$param]);
}
}
foreach ($this->getFilterableAttributes() as $attribute) {
if (isset($query[$attribute->getAttributeCode()])) {
unset($query[$attribute->getAttributeCode()]);
}
}
$this->_queryParams = $query;
}
return $this->_queryParams;
}
示例3: __construct
/**
* Constructor
*
* @param array $args
*/
public function __construct(array $args = array())
{
$this->_categoryResource = isset($args['resource']) ? $args['resource'] : Mage::getResourceSingleton('enterprise_catalog/category');
$this->_request = !empty($args['request']) ? $args['request'] : Mage::app()->getFrontController()->getRequest();
$this->_response = !empty($args['response']) ? $args['response'] : Mage::app()->getFrontController()->getResponse();
$this->_storeId = isset($args['storeId']) ? $args['storeId'] : Mage::app()->getStore()->getId();
$fromStore = $this->_request->getQuery('___from_store');
$this->_prevStoreId = isset($args['prevStoreId']) ? $args['prevStoreId'] : (!empty($fromStore) ? Mage::app()->getStore($fromStore)->getId() : $this->_storeId);
$this->_config = isset($args['config']) ? $args['config'] : Mage::app()->getConfig();
$this->_seoSuffix = (string) $this->_config->getNode(Mage_Catalog_Helper_Category::XML_PATH_CATEGORY_URL_SUFFIX, 'store', (int) $this->_prevStoreId);
$this->_newStoreSeoSuffix = (string) $this->_config->getNode(Mage_Catalog_Helper_Category::XML_PATH_CATEGORY_URL_SUFFIX, 'store', (int) $this->_storeId);
if (isset($args['baseUrl'])) {
$this->_baseUrl = $args['baseUrl'];
}
}
示例4: _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;
}