本文整理汇总了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);
}
示例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;
}
示例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());
}
示例4: load
/**
* {@inheritdoc}
*/
public function load(FilterInterface $additionalFilter = null)
{
return $this->asset->load($additionalFilter);
}