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


PHP UrlGenerator::asset方法代码示例

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


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

示例1: getUrl

 /**
  * {@inheritdoc}
  * @throws \Plank\Mediable\Exceptions\MediaUrlException If media's disk is not publicly accessible
  */
 public function getUrl()
 {
     $path = $this->getPublicPath();
     $url = $this->getDiskConfig('url');
     if ($url) {
         if ($this->isInWebroot()) {
             $path = $this->media->getDiskPath();
         }
         return rtrim($url, '/') . '/' . trim($path, '/');
     }
     return $this->url->asset($path);
 }
开发者ID:plank,项目名称:laravel-mediable,代码行数:16,代码来源:LocalUrlGenerator.php

示例2: asset

 /**
  * Generate a HTML link to an asset
  *
  * @param  string $url
  * @param  string $title
  * @param  array  $attributes
  * @param  bool   $https
  * @return string
  */
 public function asset($url, $title = null, $attributes = array(), $https = null)
 {
     $url = $this->url->asset($url, $https);
     if (is_null($title)) {
         $title = $url;
     }
     return '<a href="' . $url . '"' . $this->attributes($attributes) . '>' . $this->entities($title) . '</a>';
 }
开发者ID:laravelbook,项目名称:laravel4-powerpack,代码行数:17,代码来源:HTML.php

示例3: asset

 /**
  * Generate a URL to an application asset.
  *
  * @param  string $path
  * @param  bool|null $secure
  * @return string
  */
 public function asset($path, $secure = null)
 {
     // add support for remote urls
     if (stristr($path, '//') !== false) {
         return $path;
     }
     $path = $this->fallback($path);
     return parent::asset($path, $secure);
 }
开发者ID:BryceHappy,项目名称:lavender,代码行数:16,代码来源:UrlGenerator.php

示例4: asset

 public function asset($path, $secure = null)
 {
     if ($this->manifest->contains($path)) {
         $path = $this->manifest->get($path);
         if (strpos($path, 'http') === 0 || strpos($path, '//')) {
             return $path;
         }
     }
     return parent::asset($path, $secure);
 }
开发者ID:nealstammers,项目名称:laravel-asset-manifest,代码行数:10,代码来源:AssetUrlGenerator.php

示例5: asset

 /**
  * Generate a URL to an application asset.
  *
  * @param  string  $path
  * @param  bool    $secure
  * @return string
  */
 public function asset($path, $secure = null)
 {
     // Start looking for a CDN json file
     $checkDir = dirname(public_path() . '/' . $path);
     // Look up through the directories looking for a
     // CDN json file
     while ($checkDir !== public_path()) {
         $cdnJsonPath = $checkDir . '.cdn.json';
         if (File::isFile($cdnJsonPath)) {
             $json = File::get($cdnJsonPath);
             $cdnObject = json_decode($json);
             $baseUrl = $secure || Request::secure() ? $cdnObject->https : $cdnObject->http;
             return $baseUrl . '/' . $cdnObject->prefix . '/' . $path;
         }
         $checkDir = dirname($checkDir);
     }
     return parent::asset($path, $secure);
 }
开发者ID:thomaswelton,项目名称:laravel-rackspace-opencloud,代码行数:25,代码来源:UrlGenerator.php

示例6: asset

 /**
  * Generate a URL to an application asset.
  *
  * @param  string $path
  * @param  bool|null $secure
  * @return string
  */
 public function asset($path, $secure = null)
 {
     if ($this->isValidUrl($path)) {
         return $path;
     }
     if (!LanguageDetector::isRtl()) {
         return parent::asset($path, $secure);
     }
     if (!strpos($path, '/rtlweb/rtler/assets/css/rtl.css')) {
         $backendUri = Config::get('cms.backendUri', 'backend');
         $requestUrl = Request::url();
         if (File::exists(base_path(dirname($path)) . '.rtl.' . File::extension($path))) {
             $path = dirname($path) . '.rtl.' . File::extension($path);
         } else {
             if (File::extension($path) == 'css' && (strpos($requestUrl, $backendUri) || strpos($path, 'plugins/') || strpos($path, 'modules/'))) {
                 $path = CssFlipper::flipCss($path);
             }
         }
     }
     return parent::asset($path, $secure);
 }
开发者ID:sajjad-ser,项目名称:oc-rtler,代码行数:28,代码来源:UrlGenerator.php

示例7: asset

 /**
  * Generate a URL to an application asset.
  *
  * @param string $path
  * @param bool|null $secure
  * @return string 
  * @static 
  */
 public static function asset($path, $secure = null)
 {
     return \Illuminate\Routing\UrlGenerator::asset($path, $secure);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例8: image

 /**
  * Create a HTML image input element.
  *
  * @param  string  $url
  * @param  string  $name
  * @param  array   $attributes
  * @return string
  */
 public function image($url, $name = null, $attributes = array())
 {
     $attributes['src'] = $this->url->asset($url);
     return $this->input('image', $name, null, $attributes);
 }
开发者ID:GeorgeShazkho,项目名称:micros-de-conce,代码行数:13,代码来源:FormBuilder.php

示例9: linkAsset

 /**
  * Generate a HTML link to an asset.
  *
  * @param  string  $url
  * @param  string  $title
  * @param  array   $attributes
  * @param  bool    $secure
  * @return string
  */
 public function linkAsset($url, $title = null, $attributes = array(), $secure = null)
 {
     $url = $this->url->asset($url, $secure);
     return $this->link($url, $title ?: $url, $attributes, $secure);
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:14,代码来源:HtmlBuilder.php

示例10: routeToAsset

 /**
  * @param string $asset
  * @return string
  */
 public function routeToAsset($asset)
 {
     return $this->urlGenerator->asset('packages/sleeping-owl/admin/' . $asset);
 }
开发者ID:GlobalsDD,项目名称:admin,代码行数:8,代码来源:Router.php

示例11: getPathUrl

 /**
  * Returns the corresponding URL for the given fully qualified path.
  * If a URL cannot be determined a Runtime Exception is thrown.
  *
  * @param  string  $path
  * @return string
  * @throws \RuntimeException
  */
 public function getPathUrl($path)
 {
     $path = $this->stripPublicPath($path);
     return $this->urlGenerator->asset($this->removeWindowsSeparator($path));
 }
开发者ID:sohailaammarocs,项目名称:lfc,代码行数:13,代码来源:IlluminateGenerator.php

示例12: asset

 /**
  * Generate a asset url for the specified module.
  *
  * @param  	string   $name
  * @param 	string   $url
  * @param 	boolean  $secure
  * @return 	string
  */
 public function asset($name, $url, $secure = false)
 {
     return $this->url->asset(basename($this->getAssetsPath()) . "/{$name}/" . $url, $secure);
 }
开发者ID:acmadi,项目名称:modules-1,代码行数:12,代码来源:Module.php

示例13: outputJsInBlade

 /**
  * @return string
  */
 public function outputJsInBlade()
 {
     $path = $this->compileScriptMaterial();
     return '<script src="' . $this->url->asset($path) . '"></script>';
 }
开发者ID:darrengopower,项目名称:framework,代码行数:8,代码来源:Material.php

示例14: asset

 public function asset($path, $secure = null)
 {
     return parent::asset(static::revPath($path), $secure);
 }
开发者ID:bcmw,项目名称:laravel-skeleton,代码行数:4,代码来源:UrlGenerator.php


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