本文整理汇总了PHP中Uploader::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Uploader::url方法的具体用法?PHP Uploader::url怎么用?PHP Uploader::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uploader
的用法示例。
在下文中一共展示了Uploader::url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Render an image path with HTML.
*
* @return string
*/
public function get()
{
$that = $this;
// Using cache to reduce request.
$ckey = 'attachment-' . $this->attachmentId;
if (!($attachment = Cache::get($ckey))) {
$attachment = $that->getAttachmentProvider()->findById($that->attachmentId);
Cache::put($ckey, $attachment, 60);
}
// Having scale, but not generate yet!
if (!is_object($attachment) and strpos($this->attachmentId, '_')) {
preg_match('|(.*)_(.*)|', $this->attachmentId, $matches);
$attachment = $this->resizeFromMasterFile($matches[1], $matches[2]);
}
if (is_object($attachment)) {
$location = $attachment->getAttribute('location');
if (preg_match('/^http/', $location)) {
return $location;
}
return $this->uploader->url($location);
}
$failure = array_get($this->config, 'placeholder');
return $failure instanceof Closure ? $failure($this->attachmentId, $this) : false;
}