method groupCompile documentation in bbn\Cdn\Compiler
Compiles together a group of files and returns the result as an array.
function(array $files, bool $test = false)
{
$codes = [];
if (!empty($files)) {
/** @var array $codes Will contain the raw content of each files */
// Mix of CSS and javascript: the JS adds the CSS to the head before executing
if ($c = $this->getContent($files, $test)) {
$e = Str::fileExt($files[0]);
foreach (self::$types as $type => $exts) {
foreach ($exts as $ext) {
if ($ext === $e) {
$mode = $type;
break;
}
}
}
$codes[$mode ?? $e][] = [
'code' => $c,
'file' => X::basename(end($files)),
'dir' => X::dirname(end($files))
];
}
else {
throw new \Exception("Impossible to get content from $f");
}
}
return $codes;
}
Compiles together a group of files and returns the result as an array. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2024
BBN Solutions