本文整理汇总了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();
}
示例2: getRequest
public function getRequest()
{
static $request;
if (!$request) {
$request = new sfWebRequest();
$request->initialize($this);
}
return $request;
}
示例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();
}
示例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();
}
示例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');