本文整理汇总了PHP中Zend_Controller_Request_Http::isGet方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Request_Http::isGet方法的具体用法?PHP Zend_Controller_Request_Http::isGet怎么用?PHP Zend_Controller_Request_Http::isGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Request_Http
的用法示例。
在下文中一共展示了Zend_Controller_Request_Http::isGet方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listAction
public function listAction()
{
$id_category = $this->getParam('category_id');
var_dump($id_category);
$fo = new Zend_Controller_Request_Http();
$fo->isGet();
// action body
}
示例2: canonicalizePageNumber
/**
* Ensures that the page that has been requested is valid based on the total
* number of results. If it's not valid, the page is redirected to the last
* valid page (via a response exception).
*
* @param integer $page
* @param integer $perPage
* @param integer $total
* @param string $linkType
* @param mixed $linkData
*/
public function canonicalizePageNumber($page, $perPage, $total, $linkType, $linkData = null)
{
if ($this->getResponseType() != 'html' || !$this->_request->isGet()) {
return;
}
if ($perPage < 1 || $total < 1) {
return;
}
$page = max(1, $page);
$maxPage = ceil($total / $perPage);
if ($page <= $maxPage) {
return;
// within the range
}
$params = $_GET;
if ($maxPage <= 1) {
unset($params['page']);
} else {
$params['page'] = $maxPage;
}
$redirectUrl = $this->_buildLink($linkType, $linkData, $params);
throw $this->responseException($this->responseRedirect(XenForo_ControllerResponse_Redirect::RESOURCE_CANONICAL, $redirectUrl));
}
示例3: testIsOptions
public function testIsOptions()
{
$_SERVER['REQUEST_METHOD'] = 'OPTIONS';
$this->assertTrue($this->_request->isOptions());
$this->assertFalse($this->_request->isGet());
}
示例4: _checkSession
/**
* _checkSession If $_GET['reset'] is set, reset the SESSION_NAMESPACE
*
* @param Zend_Controller_Request_Http $req
* @return void
*/
private function _checkSession($req)
{
if ($req->isGet() && null !== ($reset = $this->_getParam('reset'))) {
$this->session->query = null;
$this->session->searchFormState = null;
}
}
示例5: checkAuthorizeRequest
/**
* Check authorize request for validity and return token
*
* @return Mage_Oauth_Model_Token
*/
public function checkAuthorizeRequest()
{
if (!$this->_request->isGet()) {
Mage::throwException('Request is not GET');
}
$this->_requestType = self::REQUEST_AUTHORIZE;
$this->_fetchProtocolParamsFromQuery();
$this->_initToken();
return $this->_token;
}
示例6: _getStyleLanguageChangerParams
protected function _getStyleLanguageChangerParams(Zend_Controller_Request_Http $request)
{
$params = array();
$canChangeStyleLanguage = $request->isGet() && empty($this->_viewStateChanges['styleId']);
if ($request->isGet()) {
if (!empty($this->_viewStateChanges['styleId'])) {
$params['canChangeStyle'] = false;
} else {
$styles = XenForo_Application::isRegistered('styles') ? XenForo_Application::get('styles') : array();
if (count($styles) <= 1) {
$params['canChangeStyle'] = false;
} else {
if (XenForo_Visitor::hasInstance() && XenForo_Visitor::getInstance()->is_admin) {
$params['canChangeStyle'] = count($styles) > 1;
} else {
$changable = 0;
$params['canChangeStyle'] = false;
foreach ($styles as $style) {
if ($style['user_selectable']) {
$changable++;
if ($changable > 1) {
$params['canChangeStyle'] = true;
break;
}
}
}
}
}
}
$languages = XenForo_Application::isRegistered('languages') ? XenForo_Application::get('languages') : array();
$params['canChangeLanguage'] = count($languages) > 1;
} else {
$params['canChangeStyle'] = false;
$params['canChangeLanguage'] = false;
}
return $params;
}
示例7: _getLanguageChangerParams
protected function _getLanguageChangerParams(Zend_Controller_Request_Http $request)
{
$params = array();
if ($request->isGet()) {
$languages = XenForo_Application::isRegistered('languages') ? XenForo_Application::get('languages') : array();
$params['canChangeLanguage'] = count($languages) > 1;
} else {
$params['canChangeLanguage'] = false;
}
return $params;
}