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


PHP Zend_Controller_Request_Http::getParam方法代码示例

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


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

示例1: assert

 /**
  * 判断是否有访问某个游戏的条件
  * 
  * @see Zend_Acl_Assert_Interface::assert()
  */
 public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null, $privilege = null)
 {
     if ($this->_request->has('gametype')) {
         $roleData = ZtChart_Model_Acl_Loader::getInstance()->getRole($role->getRoleId());
         return in_array($this->_request->getParam('gametype'), $roleData['role_gametype']);
     }
     return true;
 }
开发者ID:starflash,项目名称:ZtChart-ZF1-Example,代码行数:13,代码来源:GameType.php

示例2: test_marshall_PUT_body_as_params

 public function test_marshall_PUT_body_as_params()
 {
     $this->request->setMethod('PUT');
     $this->request->setRawBody('param1=value1&param2=value2');
     $this->plugin->preDispatch($this->request);
     $this->assertEquals('value1', $this->request->getParam('param1'));
     $this->assertEquals('value2', $this->request->getParam('param2'));
 }
开发者ID:netvlies,项目名称:zf,代码行数:8,代码来源:PutHandlerTest.php

示例3: authenticate

 /**
  * Performs an authentication attempt
  *
  * @throws Zend_Auth_Adapter_Exception If authentication cannot be performed
  * @return Zend_Auth_Result
  */
 public function authenticate()
 {
     if (empty($this->_request) || empty($this->_response)) {
         throw new Zend_Auth_Adapter_Exception('Request and Response objects must be set before calling authenticate method');
     }
     if ($this->_request->getParam('module') != 'download') {
         throw new Zend_Auth_Adapter_Exception('Wrong endpoint');
     }
     try {
         $token = $this->_request->getParam('downloadToken');
         if (!$token instanceof Download\Model\DownloadTokenModel) {
             throw new Zend_Auth_Adapter_Exception("Download token data is missing", 401);
         }
         if ($token->authType == \App_Controller_Plugin_Auth::AUTH_TYPE_EXTERNAL) {
             $apiId = $token->apiId;
             $apiIdMapper = Application\Model\Mapper\APIIdMapper::getInstance();
             $res = $apiIdMapper->findOneByApiId($apiId);
             if (empty($res)) {
                 throw new \Application\Exceptions\NotFoundException("Api id '{$apiId}' not found (at Mongo)");
             }
             $orgId = $res->getOrgId();
             $apiUserId = 'API_' . $apiId;
             if (empty($orgId)) {
                 throw new Zend_Auth_Adapter_Exception("Organization id not defined in Api id '{$apiId}' ");
             }
             $result = array('id' => $apiUserId, 'apiId' => $apiId, 'username' => 'api_' . $orgId, 'monetaryDataAccess' => $res->getMonetaryDataAccess(), 'orgId' => $orgId, 'role' => 'admin', 'authType' => App_Controller_Plugin_Auth::AUTH_TYPE_DOWNLOAD_TOKEN);
         } else {
             if ($username = $token->username) {
                 $userMapper = Application\Model\Mapper\UserMapper::getInstance();
                 $res = $userMapper->findOneByUserName($username);
                 if (empty($res)) {
                     throw new \Application\Exceptions\NotFoundException("User name '{$username}' not found");
                 }
                 $orgId = $res->getOrganizationId();
                 if (empty($orgId)) {
                     throw new Zend_Auth_Adapter_Exception("User '{$username}' has no orgId");
                 }
                 $result = array('id' => $res->id, 'username' => $username, 'monetaryDataAccess' => $res->getMonetaryDataAccess(), 'role' => $res->getRole(), 'orgId' => $orgId, 'authType' => App_Controller_Plugin_Auth::AUTH_TYPE_DOWNLOAD_TOKEN, 'language' => $res->language);
             }
         }
         //             App_Controller_Plugin_TrackingToken::generateToken($username, $orgId);
         //             $orgSrv = \Application\Service\OrgService::getInstance();
         //             $organization = $orgSrv->load($orgId);
         //             if (empty($organization)) {
         //                 throw new \Application\Exceptions\NotFoundException("Org '$orgId' not found");
         //             }
         if ($token->impersonation) {
             $result['impersonation'] = $token->impersonation;
         }
         $result['downloadToken'] = $token;
         return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $result);
     } catch (Exception $e) {
         \App::log()->err($e->getMessage());
     }
     \App::log()->warn("Download authentication failed: Token => " . @$token->id ?: null);
     return new Zend_Auth_Result(Zend_Auth_Result::FAILURE, null);
 }
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:63,代码来源:DownloadToken.php

示例4: __construct

 /**
  * Constructor to setup the strategy
  */
 public function __construct(Zend_Controller_Request_Http $request, Zend_Controller_Response_Http $response)
 {
     $this->strategies = new Zend_Loader_PluginLoader(array('App_Auth_Strategy' => 'App/Auth/Strategy'));
     $auth = Zend_Auth::getInstance();
     $this->user = $auth->getIdentity();
     $this->request = $request;
     $this->response = $response;
     $this->setStrategy($this->request->getParam('strategy', 'db'));
 }
开发者ID:kevindragon221,项目名称:Webdesktop,代码行数:12,代码来源:Adapter.php

示例5: noControllerResponse

 public static function noControllerResponse(XenForo_RouteMatch $routeMatch, Zend_Controller_Request_Http $request)
 {
     self::sendErrorPageHeaders();
     if (XenForo_Application::debugMode()) {
         echo 'Failed to get controller response and reroute to error handler (' . $routeMatch->getControllerName() . '::action' . $routeMatch->getAction() . ')';
         if ($request->getParam('_exception')) {
             echo self::getExceptionTrace($request->getParam('_exception'));
         }
     } else {
         echo self::_getPhrasedTextIfPossible('An unexpected error occurred. Please try again later.', 'unexpected_error_occurred');
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:12,代码来源:Error.php

示例6: init

 /**
  * Init method.
  * Call during construction of the controller to perform some default initialization.
  */
 public function init()
 {
     parent::init();
     $this->getResponse()->setHeader('Content-Type', $this->_mimetype);
     $this->_request->setParam('view', $this->_helper->viewRenderer);
     $this->_helper->viewRenderer->setViewScriptPathSpec(":action.phtml");
     $this->view->addHelperPath(USVN_HELPERS_DIR, 'USVN_View_Helper');
     $this->_helper->layout->setLayout('default');
     $this->_request->setParam('project', $this->_request->getParam('project', '__NONE__'));
     $this->_request->setParam('area', $this->_request->getParam('area', '__NONE__'));
     if ($this->_mimetype != 'text/html') {
         $this->_helper->viewRenderer->setNoRender();
     }
 }
开发者ID:jiangti,项目名称:usvn,代码行数:18,代码来源:Controller.php

示例7: linkDoctorAccount

 public function linkDoctorAccount(Doctor $doctor)
 {
     $token = AccessToken::getByDoctor($doctor);
     if (!$token instanceof AccessToken) {
         $token = AccessToken::create();
         $token->setDoctor($doctor);
     }
     $client = MedOptima_Service_Google_Config::getCalendarClient();
     if ($this->_request->getParam('code')) {
         $client->authenticate($this->_request->getParam('code'));
         (new MedOptima_Service_Google_AccessToken_Initializer())->updateFromEncodedData($token, $client->getAccessToken());
     }
     $token->save();
     return true;
 }
开发者ID:Rademade,项目名称:MedOptima,代码行数:15,代码来源:Account.php

示例8: preDispatch

 /**
  * @param Zend_Controller_Request_Http $request
  */
 public function preDispatch($request)
 {
     // dont filter anything if a resident is logged in
     $session = new Zend_Session_Namespace();
     if ($session->currentResidentId) {
         $session->currentResident = Table_Residents::getInstance()->find($session->currentResidentId)->current();
         return;
     }
     // allow index and session controller to all
     if ($request->getControllerName() == 'index' || $request->getControllerName() == 'session') {
         return;
     }
     // Authenticate direct requests for non-html stuff
     if ($request->getParam('format') !== "html") {
         // The requestor provided a username
         if (isset($_SERVER['PHP_AUTH_USER'])) {
             $resident = Table_Residents::getInstance()->findResidentByEmailAndPasswordhash($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
             if ($resident) {
                 $session->currentResidentId = $resident->getId();
                 $session->currentResident = $resident;
                 return;
             }
         }
         header('WWW-Authenticate: Basic realm="WG-Organizer"');
         header('HTTP/1.0 401 Unauthorized');
         die;
     }
     // else redirect to frontpage
     $request->setControllerName('index');
     $request->setActionName('index');
 }
开发者ID:Velrok,项目名称:wg-organizer,代码行数:34,代码来源:AuthentificationPlugin.php

示例9: testGetAliasedParamZF2455

 public function testGetAliasedParamZF2455()
 {
     $this->_request->setParam('controller', 'value');
     $this->_request->setAlias('var1', 'controller');
     $this->assertEquals('value', $this->_request->getParam('controller'));
     $this->assertEquals('value', $this->_request->getParam('var1'));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:7,代码来源:HttpTest.php

示例10: testParamSourcesHonoredByGetParam

 /**
  * @group ZF-1798
  */
 public function testParamSourcesHonoredByGetParam()
 {
     $_GET = array('foo' => 'bar');
     $_POST = array('foo' => 'baz');
     $this->_request->setParamSources(array('_POST'));
     $this->assertEquals('baz', $this->_request->getParam('foo'));
 }
开发者ID:nbcutech,项目名称:o3drupal,代码行数:10,代码来源:HttpTest.php

示例11: getParam

 /**
  * Retrieve a parameter.
  *
  * Retrieves a parameter from the instance. Priority is in the order of
  * userland parameters (see {@link setParam()}), $_GET, $_POST. If a
  * parameter matching the $key is not found, null is returned.
  *
  * If the $key is an alias, the actual key aliased will be used.
  *
  * @param mixed $key
  * @param mixed $default Default value to use if key not found
  * @return mixed
  */
 public function getParam($key, $default = null)
 {
     $param = parent::getParam($key, $default);
     if (is_string($param)) {
         return trim($param);
     }
     return $param;
 }
开发者ID:douggr,项目名称:benri,代码行数:21,代码来源:Http.php

示例12: factory

 /**
  * 通过工厂方法快速获取 YUN_Paginator 对象
  *
  * @param  array  $data
  * @param  integer        $perPage
  * @param  string         $uriSegment
  * @return YUN_Paginator
  */
 public static function factory($data, Zend_Controller_Request_Http $request, $perPage = 20, $uriSegment = 'page')
 {
     $paginator = Zend_Paginator::factory($data);
     $paginator->setItemCountPerPage($perPage);
     // 每页显示数
     $paginator->setCurrentPageNumber($request->getParam($uriSegment));
     // 设置当前页
     return $paginator;
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:17,代码来源:Paginator.php

示例13: 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

示例14: testPostDispatchQuitsWithFalseUserErrorHandlerParam

 public function testPostDispatchQuitsWithFalseUserErrorHandlerParam()
 {
     $front = Zend_Controller_Front::getInstance();
     $front->resetInstance();
     $front->setParam('noErrorHandler', true);
     $this->response->setException(new Zend_Controller_Dispatcher_Exception('Testing controller exception'));
     $this->request->setModuleName('foo')->setControllerName('bar')->setActionName('baz');
     $this->plugin->postDispatch($this->request);
     $this->assertNull($this->request->getParam('error_handler'));
 }
开发者ID:travisj,项目名称:zf,代码行数:10,代码来源:ErrorHandlerTest.php

示例15: testSetNullParamsUnsetsKeys

 public function testSetNullParamsUnsetsKeys()
 {
     $this->_request->setParams(array('foo' => 'bar', 'bar' => 'baz'));
     $this->assertEquals('bar', $this->_request->getParam('foo'));
     $this->assertEquals('baz', $this->_request->getParam('bar'));
     $this->_request->setParams(array('foo' => null));
     $params = $this->_request->getParams();
     $this->assertFalse(isset($params['foo']));
     $this->assertTrue(isset($params['bar']));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:10,代码来源:HttpTest.php


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