I am working on a project with multiple localizations using Symfony2, and I am sharing (CSS / Images) in different folders based on the current local user.
Ex folder structure:
Resources\ public\ css\ ar\ home.css en\ home.css
** Now I need Assetic to display the correct home.CSS file based on the current user local {ar | ru} without loss of branch functions and filters **
Example - this does not work:
{% stylesheets 'bundles/atcopcore/css/{ app.request.locale }/home.css' filter='cssrewrite' %} <link rel="stylesheet" href="{{ asset_url }}" />
Note: I want to use css compine, and this cannot be done if I do the following:
<link rel="stylesheet" href="{{ asset('css/' ~ app.request.locale ~ '/home.css') }}" />
How can i do this...
I found the link, but I think there is a more professional way to do this.
How to insert style sheets with Assetic based on value in a session
Please any suggestions?
source share