Renders one asset.

@param \Ems\Contracts\Assets\Asset $asset
@param string                      $group

@return string
542851
protected function renderAsset(Asset $asset, $group)
    {
        return $asset->isInline() ? $this->renderInline($asset, $group) : $this->renderExternal($asset, $group);
    }
260516
public function get (Asset $asset) : Asset
    {
        $cache = $this->locator->get(AssetsCache::class);
        $cachedAsset = $cache->get($asset);

        if (null !== $cachedAsset)
        {
            return $cachedAsset;
        }

        return $this->addAsset($asset);
    }
631625
public function inline($asset, $content, $group = null)
    {
        $this->registry->inline($asset, $content, $group);

        return $this;
    }
688276
public function run($group, array $assets = [], $prefix = null)
    {
        $html = '';

        if (!isset($assets[$group]) || count($assets[$group]) == 0) {
            return $html;
        }

        is_null($prefix) || $this->path = rtrim($prefix, '/');

        foreach ($this->resolver->arrange($assets[$group]) as $data) {
            $html .= $this->asset($group, $data);
        }

        return $html;
    }
276691
public function renderGroup($group)
    {
        if (!isset($this->groups[$group])) {
            return PHP_EOL;
        }

        foreach ($this->groups[$group] as $handle => $data) {
            $assets[] = $this->getGroup($group, $handle);
        }

        return implode(PHP_EOL, $assets);
    }
456374
public function addAsset(Asset $asset): bool
    {
        if ($asset->getAssetCollections()->contains($this) === false) {
            $this->assets->add($asset);
            return true;
        }

        return false;
    }
755136
public function registerAsset($context, $asset)
    {
        return $this->resolveAndCall($asset, 'register', [
            isset($context['this']) ? $context['this'] : null,
        ]);
    }
659708
public function addCss($asset)
    {
        return $this->addType(Assets::CSS_COLLECTION,Assets::CSS_TYPE, $asset, $this->unifyLegacyArguments(\func_get_args(), Assets::CSS_TYPE));
    }
1074905
private function getIntegrityHtml (Asset $asset) : string
    {
        return $this->isDebug
            ? ""
            : sprintf(
                ' integrity="sha256-%s"',
                $this->registry->get($asset)->getHash()
            );
    }
69849
private function renderGroup($groupField)
    {
        $group = [];

        foreach ($groupField as $field) {
            $group[] = $this->render($field);
        }

        $this->form .= view('platform::partials.fields.groups', [
            'cols' => array_filter($group),
        ])
            ->withErrors(session()->get('errors', app(ViewErrorBag::class)))
            ->render();
    }
203956
protected function getAssetSourceUrlWithModifiedTime($source, $file, $group = null)
    {
        $this->getAssetSandboxSourceUrl($source, $group);
        if ($this->isLocalPath($source) && $this->useVersioning) {

            if (!empty($modified = $this->files->lastModified($file))) {
                $source = $source . "?{$modified}";
            }
        }

        return $source;
    }
185859
public static function assetgroups($config = array())
	{
		if (empty(self::$asset_groups))
		{
			$db = App::get('db');

			$query = $db->getQuery()
				->select('a.id', 'value')
				->select('a.title', 'text')
				->from('#__viewlevels', 'a')
				->group('a.id')
				->group('a.title')
				->group('a.ordering')
				->order('a.ordering', 'asc');

			$db->setQuery($query->toString());
			self::$asset_groups = $db->loadObjectList();

			// Check for a database error.
			if ($db->getErrorNum())
			{
				throw new Exception($db->getErrorMsg(), 500, E_WARNING);
				return false;
			}
		}

		return self::$asset_groups;
	}
1115908
public function getAsset($asset)
    {
        $assetId = Utilities::getEntityId(
            $asset,
            'WindowsAzure\MediaServices\Models\Asset'
        );

        return Asset::createFromOptions($this->_getEntity("Assets('{$assetId}')"));
    }
1012623
public function asset(string $group, ?array $asset = null): string
    {
        if (! isset($asset)) {
            return '';
        }

        $asset['source'] = $this->getAssetSourceUrl($asset['source']);

        $html = $this->html->{$group}($asset['source'], $asset['attributes']);

        return $html->toHtml();
    }
367993
protected function group($group)
    {
        return $this->dispatcher->run($group, $this->assets, $this->path);
    }
1200038
public function renderJs($assets, $group, $attributes = [])
    {
        // temporary list of assets to pipeline
        $inline_group = false;

        if (array_key_exists('loading', $attributes) && $attributes['loading'] === 'inline') {
            $inline_group = true;
            unset($attributes['loading']);
        }

        // Store Attributes
        $this->attributes = $attributes;

        // Compute uid based on assets and timestamp
        $json_assets = json_encode($assets);
        $uid = md5($json_assets . $this->js_minify . $group);
        $file = $uid . '.js';
        $relative_path = "{$this->base_url}{$this->assets_url}/{$file}";

        $buffer = null;

        if (file_exists($this->assets_dir . $file)) {
            $buffer = file_get_contents($this->assets_dir . $file) . "\n";
        } else {
            //if nothing found get out of here!
            if (empty($assets)) {
                return false;
            }

            // Concatenate files
            $buffer = $this->gatherLinks($assets, self::JS_ASSET);

            // Minify if required
            if ($this->shouldMinify('js')) {
                $minifier = new \MatthiasMullie\Minify\JS();
                $minifier->add($buffer);
                $buffer = $minifier->minify();
            }

            // Write file
            if (trim($buffer) !== '') {
                file_put_contents($this->assets_dir . $file, $buffer);
            }
        }

        if ($inline_group) {
            $output = '<script' . $this->renderAttributes(). ">\n" . $buffer . "\n</script>\n";
        } else {
            $this->asset = $relative_path;
            $output = '<script src="' . $relative_path . $this->renderQueryString() . '"' . $this->renderAttributes() . "></script>\n";
        }

        return $output;
    }
911393
protected function renderQueryString($asset = null)
    {
        $querystring = '';

        $asset = $asset ?? $this->asset;

        if (!empty($this->query)) {
            if (Utils::contains($asset, '?')) {
                $querystring .=  '&' . $this->query;
            } else {
                $querystring .= '?' . $this->query;
            }
        }

        if ($this->timestamp) {
            if (Utils::contains($asset, '?') || $querystring) {
                $querystring .=  '&' . $this->timestamp;
            } else {
                $querystring .= '?' . $this->timestamp;
            }
        }

        return $querystring;
    }