Symfony2 Jquery Twitter Bootstrap and Font awesome as public resource


under web project create public folder then put all resource there, here is mine as an example for you :

/var/www/html/mysymproject/web

var/www/html/mysymproject/web/public

var/www/html/mysymproject/web/public/bootstrap-3.2.0

var/www/html/mysymproject/web/public/font-awesome-4.2.0

var/www/html/mysymproject/web/public/js/jquery-1.11.1.min.js

ok, now here is how to add them (css and js) to the layout :

{% block stylesheets %}
{% stylesheets
‘public/bootstrap-3.2.0/css/bootstrap.min.css’
‘public/bootstrap-3.2.0/css/bootstrap-theme.min.css’
‘public/font-awesome-4.2.0/css/font-awesome.min.css’
filter=’cssrewrite’
%}
<link rel=”stylesheet” href=”{{ asset_url }}” />
{% endstylesheets %}
{% endblock %}

{% block javascripts %}
{% javascripts filter=”” output=”js/core.js” debug=true
‘public/js/jquery-1.11.1.min.js’
‘public/bootstrap-3.2.0/js/bootstrap.min.js’
%}
<script type=”text/javascript” src='{{ asset_url }}’></script>
{% endjavascripts %}
{% endblock %}

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s