本文整理汇总了PHP中SimpleUrl::getPage方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleUrl::getPage方法的具体用法?PHP SimpleUrl::getPage怎么用?PHP SimpleUrl::getPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleUrl
的用法示例。
在下文中一共展示了SimpleUrl::getPage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMakingADirectoryUrlAbsolute
function testMakingADirectoryUrlAbsolute()
{
$url = new SimpleUrl('hello/');
$this->assertEqual($url->getPath(), 'hello/');
$this->assertEqual($url->getBasePath(), 'hello/');
$this->assertEqual($url->getPage(), '');
$absolute = $url->makeAbsolute('http://host.com/I/am/here/page.html');
$this->assertEqual($absolute->getPath(), '/I/am/here/hello/');
}
示例2: isWithin
/**
* Test to see if the URL is within the directory
* tree of the realm.
* @param SimpleUrl $url URL to test.
* @return boolean True if subpath.
* @access public
*/
function isWithin($url)
{
if ($this->isIn($this->root, $url->getBasePath())) {
return true;
}
if ($this->isIn($this->root, $url->getBasePath() . $url->getPage() . '/')) {
return true;
}
return false;
}
示例3: testAbsolutePathPageSplitting
function testAbsolutePathPageSplitting()
{
$url = new SimpleUrl("http://host.com/here/there/somewhere.php");
$this->assertEqual($url->getPath(), "/here/there/somewhere.php");
$this->assertEqual($url->getPage(), "somewhere.php");
$this->assertEqual($url->getBasePath(), "/here/there/");
}