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


PHP Api::getCdnUri方法代码示例

本文整理汇总了PHP中Api::getCdnUri方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::getCdnUri方法的具体用法?PHP Api::getCdnUri怎么用?PHP Api::getCdnUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Api的用法示例。


在下文中一共展示了Api::getCdnUri方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getScriptSrc

 /**
  * Return url for javascript widget.
  * If no version is provided method will use default(current) version
  *
  * @param string $version Version of Uploadcare.com widget
  * @return string
  */
 public function getScriptSrc($version = null)
 {
     if (!$version) {
         $version = self::version;
     }
     return sprintf($this->api->getCdnUri() . '/widget/%s/uploadcare/uploadcare.full.min.js', $version);
 }
开发者ID:awatbayazidi,项目名称:uploadcare-php,代码行数:14,代码来源:Widget.php

示例2: getScriptSrc

 /**
  * Return url for javascript widget.
  * If no version is provided method will use default(current) version
  *
  * @param string $version Version of Uploadcare.com widget
  * @return string
  */
 public function getScriptSrc($version = null, $full = true)
 {
     if (!$version) {
         $version = self::version;
     }
     if ($full) {
         $tail = "uploadcare.full.min.js";
     } else {
         $tail = "uploadcare.min.js";
     }
     return sprintf($this->api->getCdnUri() . '/widget/%s/uploadcare/' . $tail, $version);
 }
开发者ID:uploadcare,项目名称:uploadcare-php,代码行数:19,代码来源:Widget.php

示例3: getUrl

 /**
  * Get url of original image
  *
  * @param string $postfix
  * @return string
  */
 public function getUrl($postfix = null)
 {
     $url = sprintf('%s/%s/', $this->api->getCdnUri(), $this->uuid);
     if ($this->default_effects) {
         $url = sprintf('%s-/%s', $url, $this->default_effects);
     }
     if ($this->filename && $postfix === null) {
         $postfix = $this->filename;
     }
     $operations = array();
     foreach ($this->operations as $i => $operation_item) {
         $part = array();
         foreach (array_keys($operation_item) as $operation_type) {
             $operation_params = $operation_item[$operation_type];
             $part[] = $operation_type;
             switch ($operation_type) {
                 case 'crop':
                     $part = $this->__addPartSize($part, $operation_params);
                     $part = $this->__addPartCenter($part, $operation_params);
                     $part = $this->__addPartFillColor($part, $operation_params);
                     break;
                 case 'resize':
                     $part = $this->__addPartSize($part, $operation_params);
                     break;
                 case 'scale_crop':
                     $part = $this->__addPartSize($part, $operation_params);
                     $part = $this->__addPartCenter($part, $operation_params);
                     break;
                 case 'effect':
                     $part = $this->__addPartEffect($part, $operation_params);
                     break;
                 case 'preview':
                     $part = $this->__addPartSize($part, $operation_params);
                     break;
                 case 'custom':
                     $part = array($operation_params);
                     break;
             }
             $part_str = join('/', $part);
             $operations[] = $part_str;
         }
     }
     if (count($operations)) {
         $operations_part = join('/-/', $operations);
         return $url . '-/' . $operations_part . '/' . $postfix;
     } else {
         return $url . $postfix;
     }
 }
开发者ID:awatbayazidi,项目名称:uploadcare-php,代码行数:55,代码来源:File.php


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