當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AssetInterface::load方法代碼示例

本文整理匯總了PHP中Assetic\Asset\AssetInterface::load方法的典型用法代碼示例。如果您正苦於以下問題:PHP AssetInterface::load方法的具體用法?PHP AssetInterface::load怎麽用?PHP AssetInterface::load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Assetic\Asset\AssetInterface的用法示例。


在下文中一共展示了AssetInterface::load方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: load

 /**
  * {@inheritdoc}
  */
 public function load(FilterInterface $additionalFilter = null)
 {
     if (!$this->innerAsset) {
         $this->createInnerAsset();
     }
     return $this->innerAsset->load($additionalFilter);
 }
開發者ID:puli,項目名稱:assetic-extension,代碼行數:10,代碼來源:LazyAsset.php

示例2: dump

 public function dump(AssetInterface $asset)
 {
     $writer = new \Assetic\AssetWriter(sys_get_temp_dir(), $this->container->getParameter('assetic.variables'));
     $ref = new \ReflectionMethod($writer, 'getCombinations');
     $ref->setAccessible(true);
     $name = $asset->getSourcePath();
     $type = substr($name, strrpos($name, '.') + 1);
     switch ($type) {
         case 'coffee':
             $asset->ensureFilter($this->container->get('assetic.filter.coffee'));
             $type = 'js';
             break;
         case 'less':
             $asset->ensureFilter($this->container->get('assetic.filter.less'));
             $type = 'css';
             break;
     }
     $combinations = $ref->invoke($writer, $asset->getVars());
     $asset->setValues($combinations[0]);
     $asset->load();
     $content = $asset->getContent();
     // because the assetic cssrewrite makes bullshit here, we need to reimplement the filter
     if ($type === 'css') {
         $content = $this->cssFilter($content, '/' . dirname($asset->getSourcePath()));
     }
     return $content;
 }
開發者ID:roomthirteen,項目名稱:Room13AsseticServerBundle,代碼行數:27,代碼來源:DumpAssetCommand.php

示例3: load

 /**
  * Loads the asset into memory and applies load filters.
  *
  * @param FilterInterface|null $additionalFilter
  */
 public function load(FilterInterface $additionalFilter = null)
 {
     $cacheKey = $this->getCacheKey($this->asset, $additionalFilter, 'load');
     if ($this->cache->has($cacheKey)) {
         $this->asset->setContent($this->cache->get($cacheKey));
         return;
     }
     $this->asset->load($additionalFilter);
     $this->cache->set($cacheKey, $this->asset->getContent());
 }
開發者ID:sunnyct,項目名稱:silexcmf-assetic,代碼行數:15,代碼來源:AssetCache.php

示例4: load

 /**
  * {@inheritdoc}
  */
 public function load(FilterInterface $additionalFilter = null)
 {
     return $this->asset->load($additionalFilter);
 }
開發者ID:bit3,項目名稱:contao-theme-plus,代碼行數:7,代碼來源:AbstractDelegatorAsset.php


注:本文中的Assetic\Asset\AssetInterface::load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。