本文整理匯總了PHP中MediaHelper::url方法的典型用法代碼示例。如果您正苦於以下問題:PHP MediaHelper::url方法的具體用法?PHP MediaHelper::url怎麽用?PHP MediaHelper::url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MediaHelper
的用法示例。
在下文中一共展示了MediaHelper::url方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testUrl
public function testUrl()
{
$result = $this->Media->url('http://example.com/img/image-png');
$this->assertNull($result);
$result = $this->Media->url('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->url('img/image-png');
$this->assertEqual($result, '/media/static/img/image-png.png');
$result = $this->Media->url('s/static/img/image-png');
$this->assertEqual($result, '/media/filter/s/static/img/image-png.png');
$result = $this->Media->url('img/image-png-x');
$this->assertNull($result);
$result = $this->Media->url('img/image-png-xyz');
$this->assertNull($result);
$result = $this->Media->url('s/transfer/img/image-png-x');
$this->assertEqual($result, '/media/filter/s/transfer/img/image-png-x.png');
$result = $this->Media->url($this->Data->settings['filter'] . 's/transfer/img/image-png-x.png');
$this->assertEqual($result, '/media/filter/s/transfer/img/image-png-x.png');
}