method compile documentation in bbn\Cdn\Compiler
Returns an array of compiled codes based on a list of files.
function(array $files, bool $test = false)
{
/** @var array $codes Will contain the raw content of each files */
$codes = [];
if (!empty($files)) {
// Mix of CSS and javascript: the JS adds the CSS to the head before executing
foreach ($files as $f) {
if ($c = $this->getContent($f, $test)) {
$e = Str::fileExt($f);
foreach (self::$types as $type => $exts) {
foreach ($exts as $ext) {
if ($ext === $e) {
$mode = $type;
break;
}
}
}
$codes[$mode ?? $e][] = [
'code' => $c,
'file' => X::basename($f),
'dir' => X::dirname($f)
];
}
else {
//die("I can't find the file $f !");
}
}
}
return $codes;
}
Returns an array of compiled codes based on a list of files. 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-2023
BBN Solutions