php - Symfony Twig Stylesheets -
within project setup i'm having directory structure css files: 
within base.html.twig file i'm loading files this:
{% block stylesheets %} {% stylesheets 'bundles/app/css/*' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %} but somehow css files within 2 folders aren't found. how 1 css included too?
the way you're doing right doesn't recursive. folders fontawesome , simplelintfont won't included. fix i'm copying stylesheets block every subfolder this:
{% block stylesheets %} {% stylesheets 'bundles/app/css/*' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %} {% block stylesheets %} {% stylesheets 'bundles/app/css/fontawesome/*' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %} {% block stylesheets %} {% stylesheets 'bundles/app/css/simplelinefont/*' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %} as ugly , duplicate code 1 combine paths cleaner solution:
{% block stylesheets %} {% stylesheets 'bundles/app/css/*' 'bundles/app/css/simplelinefont/*' 'bundles/app/css/fontawesome/*' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %}
Comments
Post a Comment