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


PHP Request::getParams方法代码示例

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


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

示例1: testParamManipulation

 /**
  * Test of params
  */
 public function testParamManipulation()
 {
     Request::setParam('foo', 'bar');
     Request::setParam('baz', 'qux');
     $this->assertEquals('bar', Request::getParam('foo'));
     $this->assertEquals('qux', Request::getParam('baz'));
     $this->assertEquals('moo', Request::getParam('qux', 'moo'));
     $this->assertEqualsArray(['foo' => 'bar', 'baz' => 'qux'], Request::getParams());
     $this->assertEqualsArray(['foo' => 'bar', 'baz' => 'qux'], Request::getAllParams());
 }
开发者ID:dezvell,项目名称:mm.local,代码行数:13,代码来源:RequestTest.php

示例2: __construct

 /**
  * Prepare request for processing
  */
 public function __construct()
 {
     // rewrite REST with "_method" param
     // this is workaround
     $this->method = strtoupper(Request::getParam('_method', Request::getMethod()));
     // get all params
     $query = Request::getQuery();
     if (is_array($query) && !empty($query)) {
         unset($query['_method']);
         $this->params = $query;
     }
     $this->data = Request::getParams();
 }
开发者ID:9618211,项目名称:framework,代码行数:16,代码来源:AbstractController.php

示例3: function

<?php

/**
 *
 *
 * @category Application
 *
 * @author   dark
 * @created  18.12.13 18:39
 */
namespace Application;

use Bluz\Proxy\Request;
return function ($alias) use($module, $controller, $view) {
    /**
     * @var Bootstrap $this
     * @var \Bluz\View\View $view
     */
    var_dump($alias);
    var_dump(Request::getParams());
    var_dump(Request::getAllParams());
    var_dump(Request::getRawParams());
    return false;
};
开发者ID:dezvell,项目名称:skeleton,代码行数:24,代码来源:route-with-other-params.php

示例4: function

 * @param  bool   $checkAccess
 * @return null|string
 * @throws ViewException
 */
return function ($module, $controller, $params = [], $checkAccess = false) {
    /**
     * @var View $this
     */
    try {
        if ($checkAccess) {
            try {
                $controllerInstance = new Controller($module, $controller);
                $controllerInstance->checkPrivilege();
            } catch (ForbiddenException $e) {
                return null;
            }
        }
    } catch (\Exception $e) {
        throw new ViewException('Url View Helper: ' . $e->getMessage());
    }
    if (null === $module) {
        $module = Request::getModule();
    }
    if (null === $controller) {
        $controller = Request::getController();
    }
    if (null === $params) {
        $params = Request::getParams();
    }
    return Router::getUrl($module, $controller, $params);
};
开发者ID:bluzphp,项目名称:framework,代码行数:31,代码来源:Url.php

示例5: doProcess

 /**
  * Do process
  *
  * @return void
  */
 protected function doProcess()
 {
     $module = Request::getModule();
     $controller = Request::getController();
     $params = Request::getParams();
     // try to dispatch controller
     try {
         // dispatch controller
         $result = $this->dispatch($module, $controller, $params);
     } catch (ForbiddenException $e) {
         $result = $this->forbidden($e);
     } catch (RedirectException $e) {
         // redirect to URL
         $result = $this->redirect($e->getUrl());
     } catch (\Exception $e) {
         $result = $this->error($e);
     }
     // setup layout, if needed
     if ($this->useLayout()) {
         // render view to layout
         // needed for headScript and headStyle helpers
         Layout::setContent($result->render());
         Response::setBody(Layout::getInstance());
     } else {
         Response::setBody($result);
     }
 }
开发者ID:bluzphp,项目名称:framework,代码行数:32,代码来源:Application.php

示例6: __construct

 /**
  * Prepare request for processing
  */
 public function __construct()
 {
     // HTTP method
     $method = Request::getMethod();
     $this->method = strtoupper($method);
     // get path
     // %module% / %controller% / %id% / %relation% / %id%
     $path = Router::getCleanUri();
     $this->params = explode('/', rtrim($path, '/'));
     // module
     $this->module = array_shift($this->params);
     // controller
     $this->controller = array_shift($this->params);
     $data = Request::getParams();
     unset($data['_method'], $data['_module'], $data['_controller']);
     $this->data = $data;
 }
开发者ID:bluzphp,项目名称:framework,代码行数:20,代码来源:AbstractMapper.php


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