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


PHP Zend_Controller_Request_Http::setParamSources方法代码示例

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


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

示例1: testParamSourcesHonoredByGetParam

 /**
  * 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:lortnus,项目名称:zf1,代码行数:10,代码来源:HttpTest.php

示例2: testGetParamsShouldHonorParamSourcesSetting

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

示例3: actionStaffShare

 public function actionStaffShare()
 {
     $visitor = XenForo_Visitor::getInstance();
     if (!$visitor->hasPermission('general', 'bdSocialShare_staffShare')) {
         return $this->responseNoPermission();
     }
     $url = $this->_input->filterSingle('url', XenForo_Input::STRING);
     if (empty($url)) {
         return $this->responseView('bdSocialShare_ViewPublic_Misc_StaffShare_UrlForm', 'bdsocialshare_staff_share_url_form');
     }
     $request = new Zend_Controller_Request_Http($url);
     $request->setParamSources(array());
     $routeMatch = bdSocialShare_Listener::getDependencies()->route($request);
     $shareable = $this->getModelFromCache('bdSocialShare_Model_Publisher')->getShareableForRouteMatchAndRequest($routeMatch, $request);
     if (empty($shareable)) {
         return $this->responseMessage(new XenForo_Phrase('bdsocialshare_url_x_is_not_supported', array('url' => $url)));
     }
     $userModel = $this->getModelFromCache('XenForo_Model_User');
     $viewingUserGuest = $userModel->getVisitingGuestUser();
     $userModel->bdSocialShare_prepareViewingUser($viewingUserGuest);
     $shareable->setViewingUser($viewingUserGuest);
     $publisherModel = $this->getModelFromCache('bdSocialShare_Model_Publisher');
     $facebookAccounts = false;
     if (bdSocialShare_Option::hasPermissionFacebook($viewingUserGuest)) {
         $facebookAccounts = $this->getModelFromCache('bdSocialShare_Model_Facebook')->getAccounts();
     }
     $twitterAccounts = false;
     if (bdSocialShare_Option::hasPermissionTwitter($viewingUserGuest)) {
         $twitterAccounts = $this->getModelFromCache('bdSocialShare_Model_Twitter')->getAccounts();
     }
     if ($this->isConfirmedPost()) {
         $target = $this->_input->filterSingle('target', XenForo_Input::STRING);
         $targetId = $this->_input->filterSingle('target_id', XenForo_Input::STRING);
         $data = $this->_input->filter(array('userText' => XenForo_Input::STRING, 'title' => XenForo_Input::STRING, 'description' => XenForo_Input::STRING, 'image' => XenForo_Input::STRING));
         $data['link'] = $shareable->getLink($publisherModel);
         $staffShareSharable = new bdSocialShare_Shareable_StaffShare($data);
         $published = false;
         try {
             $published = $publisherModel->publish($target, $targetId, $staffShareSharable, $viewingUserGuest);
         } catch (XenForo_Exception $e) {
             XenForo_Error::logException($e);
         }
         if ($published) {
             XenForo_Model_Log::logModeratorAction('bdsocialshare_all', $data, $target, array('target_id' => $targetId));
             return $this->responseMessage(new XenForo_Phrase('bdsocialshare_staff_share_published_successfully'));
         } else {
             return $this->responseError(new XenForo_Phrase('unexpected_error_occurred'));
         }
     }
     $viewParams = array('facebookAccounts' => $facebookAccounts, 'twitterAccounts' => $twitterAccounts, 'hasAdminPermissionOption' => $visitor->hasAdminPermission('option'), 'url' => $url, 'link' => $shareable->getLink($publisherModel), 'userText' => strval($shareable->getUserText($publisherModel)), 'title' => strval($shareable->getTitle($publisherModel)), 'description' => strval($shareable->getDescription($publisherModel)), 'image' => $shareable->getImage($publisherModel));
     return $this->responseView('bdSocialShare_ViewPublic_Misc_StaffShare', 'bdsocialshare_staff_share', $viewParams);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:52,代码来源:Misc.php


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