Questions tagged [assetic]

Assetic is an asset management framework for PHP.

Assetic is an asset management framework for PHP 5.3.

Assetic combines two major ideas: assets and filters. The assets are files such as CSS, JavaScript and image files. The filters are things that can be applied to these files before they are served to the browser. This allows a separation between the asset files stored in the application and the files actually presented to the user.

https://github.com/kriswallsmith/assetic

696 questions
104
votes
6 answers

Path of assets in CSS files in Symfony 2

Problem I have a CSS file with some paths in it (for images, fonts, etc.. url(..)). My path structure is like this: ... +-src/ | +-MyCompany/ | +-MyBundle/ | +-Resources/ | +-assets/ | +-css/ | +-stylesheets... +-web/ |…
apfelbox
  • 2,625
  • 2
  • 24
  • 26
104
votes
1 answer

Symfony get Asset Name in Assetic output

I generate my file with code like this: {% block head_stylesheets %} {% stylesheets filter='?uglifycss' '@MyBundle/Resources/public/less/myfile.less' %}
BENARD Patrick
  • 30,363
  • 16
  • 99
  • 105
81
votes
1 answer

Difference between assetic:dump and assets:install

In Symfony2, what is the difference between assetic:dump and assets:install? In what scenarios should each of these commands be used, and in what order (if order is relevant)?
Richard Keller
  • 1,980
  • 2
  • 19
  • 32
53
votes
16 answers

How to get the full url for an asset in Controller?

I need to generate some JSON content in controller and I need to get the full URL to an uploaded image situated here : /web/uploads/myimage.jpg. How can I get the full url of it? http://www.mywebsite.com/uploads/myimage.jpg
i.am.michiel
  • 10,281
  • 7
  • 50
  • 86
34
votes
3 answers

Symfony 2 - Working with assets

I need some tips on how to work with assets in Symfony 2. For example, do we have to always perform the assets:update every time an image is added ? I know Assetic take care of the management on css and javascript files but what about images? What…
Frank6
  • 1,193
  • 1
  • 11
  • 23
26
votes
2 answers

Combining Assetic Resources across inherited templates

We are building a new site using Symfony2, and Assetic looks very promising for resource management, in particular for combining and processing all js/css files together automatically. We wil have some resources that are used site wide, and some…
Ken Cooper
  • 851
  • 1
  • 9
  • 17
25
votes
4 answers

Symfony2 Path to image in twig template

I store img in Acme/DemoBundle/Resources/public/img/weather_icon/blizzard.gif I want to put this img in my template so I did and
konadrian
  • 587
  • 2
  • 9
  • 26
25
votes
5 answers

Assetic generating links but no files

I'm trying to use assetic in symfony2 to manage my css. The links are generated fine. However, no files are generated. Here's my configuration: Layout.html.twig {% stylesheets '@FooBundle/Resources/public/css/main.css' …
Thomas K
  • 6,076
  • 5
  • 39
  • 56
22
votes
9 answers

Assetic - Route "_assetic_001d5b7_0" does not exist

This question seems to have been asked multiple times but none of the solutions work for me. I'm in my prod environment, here is what I've done: cleared cache before/after doing anything attempted commenting out the _assetic stuff in config_dev…
greg
  • 6,853
  • 15
  • 58
  • 71
21
votes
1 answer

Symfony 2 Assetic Fatal error: Class 'Assetic\Util\PathUtils' not found on asset dump

I'm using Symfony version 2.1.10 with Assetic and after the last composer update I get the follwoing error when I try to run php app/console assetic:dump Dumping all dev assets. Debug mode is on. Fatal error: Class 'Assetic\Util\PathUtils' not found…
wowpatrick
  • 5,082
  • 15
  • 55
  • 86
18
votes
2 answers

How to have Assetic + sass work with Symfony2 in Windows?

I'm trying to get Assetic to run within Symfony 2.0.11 in order to use sass for css files. I've been fiddling around that issue for hours, and from what I gather the current assetic version (1.0.2) is screwed up and just can't work in windows. I…
mlarcher
  • 447
  • 1
  • 7
  • 16
16
votes
1 answer

Adding JS and CSS cleanly from included Twig templates

I'm looking to find out if there's a clean way to add JS and CSS from included templates. So, for example, if layout.html.twig has: {% include 'GenericBundle:Generic:page.html.twig' with {'data': data} %} ... {% block javascript %} {%…
Andrew Stirling
  • 275
  • 1
  • 3
  • 11
15
votes
3 answers

How to make Symfony 2 asset compilation to product different filenames?

I followed the guide on the very bottom of this article: http://symfony.com/doc/current/cookbook/assetic/asset_management.html I have this code: {% javascripts ... output='js/dist/dist.js' %}