public function __toString() { $filename = "public/" . $this->getExtension() . "/bundle_{$this->context}." . $this->getExtension(); if (!file_exists($filename) || Ntentan::$debug === true) { foreach ($this->minifiableScripts as $script) { if (Ntentan::$debug === true) { $tags .= $this->getTag(Ntentan::getUrl(TemplateEngine::loadAsset($this->getExtension() . "/" . basename($script), $script))); } else { $minifiedScript .= file_get_contents($script); } } if (Ntentan::$debug === false) { file_put_contents($filename, Minifier::minify($minifiedScript, $this->getMinifier())); } } if (Ntentan::$debug === false) { $tags = $this->getTag(Ntentan::getUrl($filename)); } foreach ($this->otherScripts as $script) { $tags .= $this->getTag(Ntentan::getUrl($script)); } return $tags; }
function load_asset($asset, $copyFrom = null) { return TemplateEngine::loadAsset($asset, $copyFrom); }