Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arodiss/asseticissue
https://github.com/arodiss/asseticissue
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/arodiss/asseticissue
- Owner: arodiss
- Created: 2014-01-03T14:18:23.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-03T15:14:24.000Z (about 11 years ago)
- Last Synced: 2023-03-24T11:57:30.114Z (almost 2 years ago)
- Language: PHP
- Size: 313 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Assetic issue
========================This is demonstration of Assetic issue, based on Symfony standard edition.
+ there's a template (`@AcmeDemoBundle:Welcome:index.html.twig`)
+ template reference stylesheet with a variable (`{theme}`) in path
+ stylesheet contains image with relative path
+ there is CssRewrite filter applied to that stylesheet
+ when running `assetic:dump`, file `web/compiled/foo.css` is generated
+ generated file contains relative path of image which is messed up (contains variable): `background-image: url("../../bundles/acmedemo/css/themes/{theme}/images/bg.jpg");`There's a way to suppress this issue by replacing last line in `\Assetic\Filter\CssRewriteFilter`:
```PHP
$asset->setContent($content, $asset->getVars(), $asset->getValues());
```
with
```PHP
$asset->setContent(
VarUtils::resolve($content, $asset->getVars(), $asset->getValues())
);
```
but this looks rather like hack then like fixLong story short
========================
```
composer install
php app/console assetic:dump
cat web/compiled/foo.css
```