本文整理汇总了PHP中MediaHelper::webroot方法的典型用法代码示例。如果您正苦于以下问题:PHP MediaHelper::webroot方法的具体用法?PHP MediaHelper::webroot怎么用?PHP MediaHelper::webroot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaHelper
的用法示例。
在下文中一共展示了MediaHelper::webroot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testWebroot
public function testWebroot()
{
$result = $this->Media->webroot('http://example.com/img/image-png');
$this->assertNull($result);
$result = $this->Media->webroot('img/special-image-&-png');
$this->assertEqual($result, 'http://fo&o:bar@example.com/media/special%5Bfolder%5D/img/special-image-%26-png.png');
$result = $this->Media->webroot('img/image-png');
$this->assertEqual($result, '/media/static/img/image-png.png');
$result = $this->Media->webroot('s/static/img/image-png');
$this->assertEqual($result, '/media/filter/s/static/img/image-png.png');
$result = $this->Media->webroot('img/image-png-x');
$this->assertNull($result);
$result = $this->Media->webroot('img/image-png-xyz');
$this->assertNull($result);
$result = $this->Media->webroot('s/transfer/img/image-png-x');
$this->assertEqual($result, '/media/filter/s/transfer/img/image-png-x.png');
$result = $this->Media->webroot($this->Data->settings['filter'] . 's/transfer/img/image-png-x.png');
$this->assertEqual($result, '/media/filter/s/transfer/img/image-png-x.png');
}