本文整理汇总了PHP中Cloudinary::cloudinary_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Cloudinary::cloudinary_url方法的具体用法?PHP Cloudinary::cloudinary_url怎么用?PHP Cloudinary::cloudinary_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cloudinary
的用法示例。
在下文中一共展示了Cloudinary::cloudinary_url方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetImageSize
public function SetImageSize($width, $height, $crop = 'fill', $gravity = 'faces')
{
CloudinaryFile::get_api();
$options = array('width' => $width, 'height' => $height, 'crop' => $crop, 'quality' => 70, 'gravity' => $gravity, 'secure_distribution' => true, 'secure' => true);
$cloudinaryID = CloudinaryFile::get_public_id($this->CloudinaryURL);
return Cloudinary::cloudinary_url($cloudinaryID . '.' . $this->Format, $options);
}
示例2: Link
public function Link()
{
CloudinaryFile::get_api();
$options = array('secure_distribution' => true, 'secure' => true);
$cloudinaryID = CloudinaryFile::get_public_id($this->CloudinaryURL);
return Cloudinary::cloudinary_url($cloudinaryID . '.' . $this->Format, $options);
}
示例3: test_cloudinary_url_from_cloudinary_field
public function test_cloudinary_url_from_cloudinary_field()
{
// should use cloud_name from config
$result = Cloudinary::cloudinary_url(new CloudinaryField("test"));
$this->assertEquals("http://res.cloudinary.com/test123/image/upload/test", $result);
// should ignore signature
$result = Cloudinary::cloudinary_url(new CloudinaryField("test#signature"));
$this->assertEquals("http://res.cloudinary.com/test123/image/upload/test", $result);
$result = Cloudinary::cloudinary_url(new CloudinaryField("rss/imgt/v123/test.jpg"));
$this->assertEquals("http://res.cloudinary.com/test123/rss/imgt/v123/test.jpg", $result);
}
示例4: userPhoto
/**
* Retrieve user photo from CDN
*
* @param string $publicId User photo public ID
* @param array $options CDN options
* @return string
*/
public function userPhoto($publicId = null, $options = [])
{
$default = $this->template->asset('/images/team.png');
if (null === $publicId) {
return $default;
}
try {
$options += ['tags' => 'user-avatar', 'crop' => 'fill'];
$cdnTargetPath = 'phpindonesia/' . $this->mode . '/';
return \Cloudinary::cloudinary_url($cdnTargetPath . $publicId, $options);
} catch (\Exception $e) {
return $default;
}
}
示例5: userPhoto
public function userPhoto($public_id = null, $options = [])
{
$default = $this->baseUrl() . '/public/images/team.png';
if (null === $public_id) {
return $default;
}
try {
$options += ['tags' => 'user-avatar', 'crop' => 'fill'];
$cdn_upload_path = 'phpindonesia/' . $this->settings['mode'] . '/';
return \Cloudinary::cloudinary_url($cdn_upload_path . $public_id, $options);
} catch (\Exception $e) {
return $default;
}
}
示例6: cloudinary_url_internal
function cloudinary_url_internal($source, &$options = array())
{
if (!isset($options["secure"])) {
$options["secure"] = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https';
}
return Cloudinary::cloudinary_url($source, $options);
}
示例7: cloudinary_url_internal
function cloudinary_url_internal($source, &$options = array())
{
if (!isset($options["secure"])) {
$options["secure"] = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';
}
return Cloudinary::cloudinary_url($source, $options);
}
示例8: CloudinaryURL
/**
* @param array $options
*/
public function CloudinaryURL($options)
{
$strSource = $this->PublicID . '.' . $this->Format;
Cloudinary::cloudinary_url($strSource, $options);
}
示例9: cloudinary_url_assertion
private function cloudinary_url_assertion($source, $options, $expected)
{
$url = Cloudinary::cloudinary_url($source, $options);
$this->assertEquals(array(), $options);
$this->assertEquals($expected, $url);
}
示例10: hasil
/**
* Display image after upload
* @var namafile
*/
public function hasil($namafile)
{
$data = array('url_gambar' => \Cloudinary::cloudinary_url($namafile));
Flash::success('Gambar berhasil di upload');
return view('hasil', $data);
}
示例11: test_escape_public_id
public function test_escape_public_id()
{
# should escape public_ids
$tests = array("a b" => "a%20b", "a+b" => "a%2Bb", "a%20b" => "a%20b", "a-b" => "a-b", "a??b" => "a%3F%3Fb");
foreach ($tests as $source => $target) {
$url = Cloudinary::cloudinary_url($source);
$this->assertEquals("http://res.cloudinary.com/test123/image/upload/{$target}", $url);
}
}