public function resolveWebPath($path)
{
if ($path && '@' !== $path[0]) {
return 'web/' . $path;
}
preg_match('/(\\@?[a-zA-Z0-9\\-_\\.\\\\]+)/', $path, $matches);
if ($matches && isset($matches[1])) {
try {
$bundle = $this->getBundle(str_replace('@', '', $matches[1]));
} catch (\InvalidArgumentException $e) {
throw new BundleNotFoundException(sprintf('Bundle for `%s` (%s) not found.', $matches[1], $path), 0, $e);
}
$targetDir = 'web/bundles/' . $this->getShortBundleName($bundle->getName());
return $targetDir . substr($path, strlen($matches[0]));
}
return 'web/' . $path;
}