Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created July 30, 2011 18:09
Show Gist options
  • Select an option

  • Save weaverryan/1115806 to your computer and use it in GitHub Desktop.

Select an option

Save weaverryan/1115806 to your computer and use it in GitHub Desktop.
Assetic relative path setup
/* /app_dev.php/css/8a38a6f_style_4.css */
/* The cssrewrite filter physically adds an extra ../ so that the this resolves correctly in dev */
body{
background: url(../../images/bodyBg.png) repeat-x;
font-family: Georgia, "Times New Roman", Times, serif;
}
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}
{% stylesheets
'css/960/960.css'
'css/960/reset.css'
'css/960/text.css'
'css/style.css'
filter="cssrewrite"
%}
<link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
{% endstylesheets %}
{% endblock %}
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
</head>
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
filters:
cssrewrite: ~
<!-- The rendered source at http://localhost/myapp/web/app_dev.php -->
<head>
<link href="/myapp/web/app_dev.php/css/8a38a6f_960_1.css" rel="stylesheet" type="text/css" />
<link href="/myapp/web/app_dev.php/css/8a38a6f_reset_2.css" rel="stylesheet" type="text/css" />
<link href="/myapp/web/app_dev.php/css/8a38a6f_text_3.css" rel="stylesheet" type="text/css" />
<link href="/myapp/web/app_dev.php/css/8a38a6f_style_4.css" rel="stylesheet" type="text/css" />
</head>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment