AsseticBundle\View\Helper\Asset::helper PHP Method

helper() protected method

protected helper ( Assetic\Asset\AssetInterface $asset, array $options = [] ) : string
$asset Assetic\Asset\AssetInterface
$options array
return string
    protected function helper(AssetInterface $asset, array $options = [])
    {
        $path = $this->baseUrl . $this->basePath . $asset->getTargetPath();
        $extension = pathinfo($path, PATHINFO_EXTENSION);
        $extension = strtolower($extension);
        if (isset($options['addFileMTime']) && $options['addFileMTime']) {
            $path .= '?' . $asset->getLastModified();
        }
        switch ($extension) {
            case 'js':
                return $this->getScriptTag($path, $options);
            case 'css':
                return $this->getStylesheetTag($path, $options);
        }
        return '';
    }