本文整理匯總了PHP中Assetic\Asset\AssetCollection::getTargetPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP AssetCollection::getTargetPath方法的具體用法?PHP AssetCollection::getTargetPath怎麽用?PHP AssetCollection::getTargetPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Assetic\Asset\AssetCollection
的用法示例。
在下文中一共展示了AssetCollection::getTargetPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createGroup
/**
* Create a new AssetCollection instance for the given group.
*
* @param string $name
* @param bool $overwrite force writing
* @return \Assetic\Asset\AssetCollection
*/
public function createGroup($name, $overwrite = false)
{
if (isset($this->groups[$name])) {
return $this->groups[$name];
}
$assets = $this->createAssetArray($name);
$filters = $this->createFilterArray($name);
$coll = new AssetCollection($assets, $filters);
if ($output = $this->getConfig($name, 'output')) {
$coll->setTargetPath($output);
}
// check output cache
$write_output = true;
if (!$overwrite) {
if (file_exists($output = public_path($coll->getTargetPath()))) {
$output_mtime = filemtime($output);
$asset_mtime = $coll->getLastModified();
if ($asset_mtime && $output_mtime >= $asset_mtime) {
$write_output = false;
}
}
}
// store assets
if ($overwrite || $write_output) {
$writer = new AssetWriter(public_path());
$writer->writeAsset($coll);
}
return $this->groups[$name] = $coll;
}
示例2: __construct
public function __construct(AssetCollection $coll)
{
$this->assets = $coll->all();
$this->filters = $coll->getFilters();
$this->output = $coll->getTargetPath();
if (false === ($pos = strpos($this->output, '.'))) {
$this->output .= '_*';
} else {
$this->output = substr($this->output, 0, $pos) . '_*' . substr($this->output, $pos);
}
}