当前位置: 首页>>代码示例>>PHP>>正文


PHP Cloudinary::cloudinary_url方法代码示例

本文整理汇总了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);
 }
开发者ID:silverstripers,项目名称:cloudinary,代码行数:7,代码来源:CloudinaryImage.php

示例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);
 }
开发者ID:silverstripers,项目名称:cloudinary,代码行数:7,代码来源:CloudinaryFile.php

示例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);
 }
开发者ID:hidayat365,项目名称:phpindonesia.or.id-membership2,代码行数:11,代码来源:CloudinaryFieldTest.php

示例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;
     }
 }
开发者ID:aswitahidayat,项目名称:phpindonesia.or.id-membership2,代码行数:21,代码来源:ViewExtension.php

示例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;
     }
 }
开发者ID:hidayat365,项目名称:phpindonesia.or.id-membership2,代码行数:14,代码来源:PlatesUriExtension.php

示例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);
 }
开发者ID:cloudinary,项目名称:cloudinary_php,代码行数:7,代码来源:Helpers.php

示例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);
}
开发者ID:vanbungkring,项目名称:24custom,代码行数:7,代码来源:cloudinary_api.php

示例8: CloudinaryURL

 /**
  * @param array $options
  */
 public function CloudinaryURL($options)
 {
     $strSource = $this->PublicID . '.' . $this->Format;
     Cloudinary::cloudinary_url($strSource, $options);
 }
开发者ID:helpfulrobot,项目名称:mademedia-silverstripe-cloudinary,代码行数:8,代码来源:CloudinaryFile.php

示例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);
 }
开发者ID:kedweber,项目名称:cloudinary_php,代码行数:6,代码来源:CloudinaryTest.php

示例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);
 }
开发者ID:balitax,项目名称:laravel-cloudinary,代码行数:10,代码来源:CloudinaryController.php

示例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);
     }
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:9,代码来源:CloudinaryTest.php


注:本文中的Cloudinary::cloudinary_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。