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


PHP sfWebRequest::initialize方法代码示例

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


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

示例1: initialize

 public function initialize(sfEventDispatcher $dispatcher, $parameters = array(), $attributes = array(), $options = array())
 {
     parent::initialize($dispatcher, $parameters, $attributes, $options);
     if (null === self::$initialPathArrayKeys) {
         self::$initialPathArrayKeys = array_keys($this->getPathInfoArray());
     }
     $this->resetPathInfoArray();
 }
开发者ID:hunde,项目名称:bsc,代码行数:8,代码来源:sfWebRequestTest.php

示例2: getRequest

 public function getRequest()
 {
     static $request;
     if (!$request) {
         $request = new sfWebRequest();
         $request->initialize($this);
     }
     return $request;
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:9,代码来源:sfContextMock.class.php

示例3: initialize

 public function initialize(sfEventDispatcher $dispatcher, $parameters = array(), $attributes = array(), $options = array())
 {
     if (isset($options['content_custom_only_for_test'])) {
         $this->content = $options['content_custom_only_for_test'];
         unset($options['content_custom_only_for_test']);
     }
     parent::initialize($dispatcher, $parameters, $attributes, $options);
     if (null === self::$initialPathArrayKeys) {
         self::$initialPathArrayKeys = array_keys($this->getPathInfoArray());
     }
     $this->resetPathInfoArray();
 }
开发者ID:sabaki-dev,项目名称:symfony1,代码行数:12,代码来源:sfWebRequestTest.php

示例4: initialize

 /**
  * @see sfWebRequest
  */
 public function initialize(sfEventDispatcher $dispatcher, $parameters = array(), $attributes = array(), $options = array())
 {
     parent::initialize($dispatcher, $parameters, $attributes, $options);
     $this->parameterHolder = new opParameterHolder();
     $this->attributeHolder = new opParameterHolder();
     $this->parameterHolder->add($parameters);
     $this->attributeHolder->add($attributes);
     // POST parameters
     $this->getParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_GET) : $_GET;
     $this->parameterHolder->add($this->getParameters);
     // POST parameters
     $this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_POST) : $_POST;
     $this->parameterHolder->add($this->postParameters);
     if ($this->isMethod(sfWebRequest::POST)) {
         $this->parameterHolder->remove('sf_method');
     }
     // additional parameters
     $this->requestParameters = $this->parseRequestParameters();
     $this->parameterHolder->add($this->requestParameters);
     $this->fixParameters();
 }
开发者ID:shotaatago,项目名称:OpenPNE3,代码行数:24,代码来源:opWebRequest.class.php

示例5: getUser

    }
    public function getUser()
    {
        return $this->user;
    }
    public function getStorage()
    {
        return $this->storage;
    }
}
$t = new lime_test(33, new lime_output_color());
$_SERVER['session_id'] = 'test';
sfConfig::set('sf_test_cache_dir', sfToolkit::getTmpDir());
$context = new sfContext();
$request = new sfWebRequest();
$request->initialize($context);
$context->request = $request;
$storage = sfStorage::newInstance('sfSessionTestStorage');
$storage->initialize($context);
$storage->clear();
$context->storage = $storage;
$user = new sfUser();
$user->initialize($context);
$context->user = $user;
// ->initialize()
$t->diag('->initialize()');
$t->is($user->getCulture(), 'en', '->initialize() sets the culture to "en" by default');
sfConfig::set('sf_i18n_default_culture', 'de');
$user->setCulture(null);
user_flush($context);
$t->is($user->getCulture(), 'de', '->initialize() sets the culture to the value of sf_i18n_default_culture if available');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:sfUserTest.php


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