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


PHP Zend_Controller_Request_Http::getParams方法代码示例

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


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

示例1: testSetGetParams

 public function testSetGetParams()
 {
     $params = array('foo' => 'bar', 'boo' => 'bah', 'fee' => 'fi');
     $this->_request->setParams($params);
     $received = $this->_request->getParams();
     $this->assertSame($params, array_intersect_assoc($params, $received));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:7,代码来源: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: 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

示例4: testGetParamsWithGetAndPost

 public function testGetParamsWithGetAndPost()
 {
     $_GET = array('get' => true);
     $_POST = array('post' => true);
     $params = array('foo' => 'bar', 'boo' => 'bah', 'fee' => 'fi');
     $this->_request->setParams($params);
     $expected = $params + $_GET + $_POST;
     $received = $this->_request->getParams();
     $this->assertSame($params, array_intersect_assoc($params, $received));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:10,代码来源:HttpTest.php

示例5: __construct

 /**
  * Конструктор модели
  * @param null|\Zend_Application_Bootstrap_Bootstrap $bootstrap
  */
 public function __construct(Zend_Application_Bootstrap_Bootstrap $bootstrap = null)
 {
     if ($bootstrap instanceof Zend_Application_Bootstrap_Bootstrap) {
         $this->_boot = $bootstrap;
     } else {
         $this->_boot = Zend_Controller_Front::getInstance()->getParam('bootstrap');
     }
     $this->_cnf = $this->_boot->getOptions();
     $this->_request = $this->_boot->getResource('Request');
     $this->_params = $this->_request->getParams();
     $this->_usersession = $this->_boot->getResource('UserSession');
     $this->_db = $this->_boot->getResource('Db');
     $this->_translate = $this->_boot->getResource('Translate');
     if (isset($this->_params['module'])) {
         $this->setModule($this->_params['module']);
     }
     if (method_exists($this, 'init')) {
         $this->init();
     }
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:24,代码来源:Model.php

示例6: getPathParts

 /**
  * Parse more Zend_Controller_Request->getPathInfo()
  * @param Zend_Controller_Request_Http $request
  * @static
  * @return boolean
  */
 public static function getPathParts($request)
 {
     $pathParts = $request->getParams();
     l($pathParts, __METHOD__ . ' $request->getParams()', Zend_Log::DEBUG);
     $pathParts['host'] = (!empty($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']) . "/";
     // SERVER_NAME?
     $pathParts['module'] = $request->getModuleName();
     /* 		$pathParts = array(
     			'host' => (!empty($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']) . "/", // SERVER_NAME?
     			'module' => $request->getModuleName(),
     			'controller' => $request->getParam('controller'), // AKA $request->getControllerName()
     			'action' => $request->getParam('action'), // AKA $request->getActionName()
     			'id' => $request->getParam('id'), // since 5/7/2009 (WAS @deprecated, moved into Zx_IndexController)
     			'page' => $request->getParam('page') // since 5/7/2009 (WAS @deprecated, moved into Zx_IndexController)
     		);
      */
     // pre-router data @deprecated, use Zend_Controller_Router_Route for route rules!
     /* 		$s = substr($_SERVER['REQUEST_URI'], 1, -1);
     		$a = explode('/', $s);
     		$pathParts['controller0'] = $a[0];
     		if (count($a) > 1) {
     			$pathParts['action0'] = $a[1];
     		}
     */
     $prefix = self::getHttpPrefix();
     $pathParts['path'] = $pathParts['controller'] . "/" . ($pathParts['action'] == 'index' ? '' : $pathParts['action'] . "/");
     $pathParts['hostpath'] = $pathParts['host'] . $pathParts['path'];
     $pathParts['url'] = $prefix . $pathParts['path'];
     $pathParts['urlController'] = $prefix . $pathParts['controller'] . "/";
     // controller only
     Zend_Registry::set('path', $pathParts);
     Zend_Registry::set('page', isset($pathParts['page']) ? $pathParts['page'] : 1);
     // set to 1 if non-exists
     #echo "DEBUG:<br><textarea rows=10 cols=100>" . print_r($pathParts, 1) . "</textarea><br>";die;
     /* Array
     (
         [host] => il
         [module] => default
         [controller] => index
         [action] => index
         [id] =>
         [url] => http://il/index/index/
     )
     */
     return $pathParts;
 }
开发者ID:BGCX262,项目名称:zx-zf-hg-to-git,代码行数:52,代码来源:FrontEnd.php

示例7: guardar

 /**
  * 
  */
 public function guardar()
 {
     $this->load->library(array("module/noticias/noticias_validar"));
     header('Content-type: application/json');
     $request = new Zend_Controller_Request_Http();
     $params = $request->getParams();
     //print_r($params);
     if ($this->noticias_validar->esValido($params)) {
         $noticia = $this->_noticia_model->getById($params["id"]);
         if (is_null($noticia)) {
             $this->_noticia_model->insert(array("fecha" => DATE("Y-m-d H:i:s"), "nombre" => $params["titulo"], "descripcion" => $params["descripcion"], "id_usuario" => $this->session->userdata('session_idUsuario')));
         } else {
             $this->_noticia_model->update(array("nombre" => $params["titulo"], "descripcion" => $params["descripcion"]), $noticia->id);
         }
         echo json_encode(array("error" => $this->noticias_validar->getErrores(), "correcto" => true));
     } else {
         echo json_encode(array("error" => $this->noticias_validar->getErrores(), "correcto" => false));
     }
 }
开发者ID:CarlosAyala,项目名称:midas-codeigniter-modulo-emergencias,代码行数:22,代码来源:mantenedor_noticias.php

示例8: _getRequestValue

 /**
  * Return Original Attribute value from Request
  *
  * @param Zend_Controller_Request_Http $request
  * @return mixed
  */
 protected function _getRequestValue(Zend_Controller_Request_Http $request)
 {
     $attrCode = $this->getAttribute()->getAttributeCode();
     if ($this->_requestScope) {
         if (strpos($this->_requestScope, '/') !== false) {
             $params = $request->getParams();
             $parts = explode('/', $this->_requestScope);
             foreach ($parts as $part) {
                 if (isset($params[$part])) {
                     $params = $params[$part];
                 } else {
                     $params = array();
                 }
             }
         } else {
             $params = $request->getParam($this->_requestScope);
         }
         if (isset($params[$attrCode])) {
             $value = $params[$attrCode];
         } else {
             $value = false;
         }
         if (!$this->_requestScopeOnly && $value === false) {
             $value = $request->getParam($attrCode, false);
         }
     } else {
         $value = $request->getParam($attrCode, false);
     }
     return $value;
 }
开发者ID:xiaoguizhidao,项目名称:emporiodopara,代码行数:36,代码来源:Abstract.php

示例9: _getParent

 private function _getParent(Zend_Controller_Request_Http $request)
 {
     $controller = $request->getControllerName();
     $action = $request->getActionName();
     if ($controller == 'index' && $action == 'collections') {
         // we don't need to know anything: we are in the root
         return '0';
     }
     if ($controller == 'browse') {
         // we are in mode selection
         // parent is the same, but action = share
         if ($action == 'mode') {
             // rebuild the query, keep only location and provider
             $parent = array('controller' => 'browse', 'action' => 'share', 'p' => $request->getParam('p'), 'l' => $request->getParam('l'));
             return X_Env::encode(http_build_query($parent));
             //$request->getParams();
         }
         //
         if ($action == 'share') {
             // we need the providerObj to know the parent :(
             $location = $request->getParam('l', false);
             if ($location === false) {
                 // NICE, parent is the ROOT
                 return '0';
             }
             $providerId = $request->getParam('p');
             $providerObj = X_VlcShares_Plugins::broker()->getPlugins($providerId);
             if ($providerObj instanceof X_VlcShares_Plugins_ResolverInterface) {
                 // easy: provider will give us the parent
                 $location = X_Env::decode($location);
                 return X_Env::encode($providerObj->getParentLocation($location));
             }
             // so providerObj is not Resolver.... fuck
             // rude way?
             return '0';
         }
         if ($action == 'selection') {
             // same as 'controls' Q_Q
             return '0';
         }
     }
     if ($controller == 'controls') {
         // fuck: how can i manage this?
         return '0';
     }
     $data = array('controller' => $controller, 'action' => $action);
     $data = array_merge($data, $request->getParams());
     return X_Env::encode(http_build_query($data));
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:49,代码来源:UpnpRenderer.php

示例10: getInput

 /**
  * Gets all input.
  *
  * @return array
  */
 public function getInput()
 {
     return $this->_request->getParams();
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:9,代码来源:Input.php

示例11: getParams

 public function getParams()
 {
     $ret = parent::getParams();
     if (in_array(self::USE_VARS, $this->_paramSources) && is_array($this->_vars)) {
         $ret += $this->_vars;
     }
     return $ret;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:8,代码来源:Request.php

示例12: setFilterDataFromRequest

 /**
  * Ustawia wartosci filtrow
  *
  * Nie wymaga przeslania danych via POST
  *
  * @param Zend_Controller_Request_Http $request
  * @return Logic_Search_Abstract
  */
 public function setFilterDataFromRequest(Zend_Controller_Request_Http $request)
 {
     if (!is_object($this->_form)) {
         throw new Logic_Search_Exception('Nie ustanowiono obiektu formularza filtrow');
     }
     if ($this->_form->isValid($request->getParams())) {
         $this->saveFilterData($this->_form->getValues());
     }
     $this->_form->setDefaults($this->getFilterData());
     return $this;
 }
开发者ID:knatorski,项目名称:SMS,代码行数:19,代码来源:Abstract.php

示例13: fopen

    echo 'Method: ', $request->getMethod(), '<br/>', "\n";
    echo 'Headrs: <br/>', "\n";
    echo '        Accept: ', $request->getHeader('accept'), '<br/>', "\n";
    echo '        User-agent: ', $request->getHeader('user-agent'), '<br/>', "\n";
    echo '        Accept-charset: ', $request->getHeader('accept-charset'), '<br/>', "\n";
    echo '        Accept-language: ', $request->getHeader('accept-language'), '<br/>', "\n";
    if ($request->getMethod() == 'PUT') {
        $fh = fopen('php://input', 'r');
        if (!$fh) {
            echo 'Can\'t load PUT data';
            die;
        }
        $data = '';
        while (!feof($fh)) {
            $data .= fgets($fh);
        }
        fclose($fh);
    } else {
        $data = print_r($request->getParams(), true);
    }
    echo 'Data: ', $data;
    echo '<br/>', "\n", 'Server vars: ', '<br/>', "\n";
    echo '<br/>', "\n", '$_SERVER: ', '<br/>', "\n";
    print_r($_SERVER);
    echo '<br/>', "\n", '$_ENV: ', '<br/>', "\n";
    print_r($_ENV);
    echo '<br/>', "\n", '$_POST: ', '<br/>', "\n";
    print_r($_POST);
    echo '<br/>', "\n", '$_GET: ', '<br/>', "\n";
    print_r($_GET);
}
开发者ID:biozshock,项目名称:PHPProxifier,代码行数:31,代码来源:server.php


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