本文整理汇总了PHP中HttpRequest::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpRequest::getInstance方法的具体用法?PHP HttpRequest::getInstance怎么用?PHP HttpRequest::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->autoloader =& AutoLoader::getInstance();
$this->httpRequest =& HttpRequest::getInstance();
// nothing here
}
示例2: loadController
private function loadController()
{
$httpRequest = HttpRequest::getInstance();
if ($httpRequest->arg(0) && $this->mod_exists(xsCleanLatinName($httpRequest->arg(0)), 'controllers')) {
$this->controller = xsCleanLatinName($httpRequest->arg(0));
if ($httpRequest->arg(1)) {
$this->action = xsCleanLatinName($httpRequest->arg(1));
} else {
$this->action = $this->config['default_action'];
}
} else {
$this->controller = $this->config['default_controller'];
$this->action = $this->config['default_action'];
}
$this->params = $httpRequest->getParams();
$this->load($this->controller, 'controllers');
}
示例3: testGetInstance
/**
* @covers Xoops\Core\HttpRequest::getInstance
* @todo Implement testGetInstance().
*/
public function testGetInstance()
{
$instance = HttpRequest::getInstance();
$this->assertInstanceOf($this->myClass, $instance);
$this->assertSame($instance, $this->object);
}