Search code examples
csssymfonyvendor

What would be the proper way to use flag-icon-css in a Symfony project?


All is in the title. I want to use flag-icon-css in my twig view. There is no instruction about composer and I don't know how to use grunt or bower. I have feeling that I should put the package in the vendor repertory but from here I have no idea what to do to have this line working :

<span class="flag-icon flag-icon-gr"></span>

Solution

  • Alternatively, you can install my simple bundle for your task, works without grunt or bower. You can install and use it like this (also here is a README file, with full description of installation):

    1. add "st/flagiconcss-bundle": "~1.0" to your composer.json file, and run composer update
    2. register the bundle in AppKernel.php file (add new ST\FlagIconCssBundle\STFlagIconCssBundle() to the bundles array in the registerBundles method of AppKernel.php file)
    3. run app/console assets:install web
    4. include the bundle's css file to your template file: <link rel="stylesheet" type="text/css" href="{{ asset('bundles/stflagiconcss/css/flag-icon.min.css') }}" />