core-bundle/src/Resources/contao/library/Contao/Template.php
public function asset($path, $packageName = null)
	{
		$url = System::getContainer()->get('assets.packages')->getUrl($path, $packageName);

		// Contao paths are relative to the <base> tag, so remove leading slashes
		return ltrim($url, '/');
	}
public function asset($path, $packageName = null)
	{
		$url = System::getContainer()->get('assets.packages')->getUrl($path, $packageName);

		// Contao paths are relative to the <base> tag, so remove leading slashes
		return ltrim($url, '/');
	}
Returns an asset path

@param string      $path
@param string|null $packageName

@return string