node.js - How to configure Symfony2 and Assetic settings for custom filters [Bootstrap, JQuery]? -
i've been working on symfony2 , problems appeared assetic compilers , filters. knows how make work on windows platform, because every example responds *nix environments?
does routes .exe
should have format: c:\\....\\
, in order done access to: java.exe
, node.exe
*nix has paths as: /usr/bin/local
or symfony style: /../../
which right option accept?
these settings worked me on:
- windows 8.1 (x64)
- phpstorm 8.0
- nodejs v0.10.35
- symfony 2.7 (recently updated)
i want share else. these of great achieve result:
use twitter bootstrap in symfony2 composer
symfony 2 , bootstrap 3 assetic config , base html template
twitter bootstrap glyphicons font's not found when using assetic in prod on symfony2
composer.json
"twbs/bootstrap": "dev-master", "oyejorge/less.php": "~1.5", "bmatzner/jquery-ui-bundle": "*", "bmatzner/jquery-bundle": "dev-master", "twbs/bootstrap-sass": "~3.3.0" (note: optional)
parameters.yml
#assetic parameters java_dir: "c:\\program files\\java\\jre1.8.0_40\\bin\\java.exe" node_dir: "c:\\program files\\nodejs\\node.exe" node_modules: "c:\\users\\fraballi\\appdata\\roaming\\npm\\node_modules" yui_jar: "%kernel.root_dir%\resources\java\yuicompressor-2.4.8.jar" cssembed: "%kernel.root_dir%\resources\java\cssembed-0.4.5.jar" less_php: "%kernel.root_dir%/../vendor/oyejorge/less.php/lessc.inc.php"
config.yml
# assetic configuration assetic: debug: "%kernel.debug%" use_controller: false bundles: [ ] java: %java_dir%" filters: cssrewrite: ~ less: node: %node_dir% node_paths: [%node_modules%] apply_to: "\.less$" yui_css: jar: "%yui_jar%" yui_js: jar: "%yui_jar%" cssembed: jar: "%cssembed%" assets: jquery_js: inputs: - '%kernel.root_dir%/../vendor/bmatzner/jquery-bundle/bmatzner/jquerybundle/resources/public/js/jquery.min.js' filters: [?yui_js] bootstrap_js: inputs: - '%kernel.root_dir%/../vendor/twbs/bootstrap/dist/js/bootstrap.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/affix.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/alert.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/button.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/carousel.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/collapse.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/dropdown.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/modal.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/popover.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/scrollspy.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/tab.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/tooltip.js' - '%kernel.root_dir%/../vendor/twbs/bootstrap/js/transition.js' filters: [?yui_js] bootstrap_less: inputs: - '%kernel.root_dir%/../vendor/twbs/bootstrap/less/bootstrap.less' filters: [less] bootstrap_fonts_woff: inputs: - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.woff' output: fonts/glyphicons-halflings-regular.woff bootstrap_fonts_ttf: inputs: - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.ttf' output: fonts/glyphicons-halflings-regular.ttf bootstrap_fonts_svg: inputs: - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.svg' output: fonts/glyphicons-halflings-regular.svg bootstrap_fonts_eot: inputs: - '%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.eot' output: fonts/glyphicons-halflings-regular.eot
commands
php app/console --env=dev cache:clear php app/console --env=dev cache:clear --no-debug php app/console --env=dev assets:install web --no-debug php app/console --env=dev assetic:dump --no-debug
twig
{% block stylesheets %} {% stylesheets '@bootstrap_less' combine=true %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css"/> {% endstylesheets %} {% endblock %}
{% block javascripts %} {% javascripts '@jquery_js' '@bootstrap_js' filter='?yui_js' combine=true %} <script src="{{ asset_url }}"></script> {% endjavascripts %} {% endblock %}
Comments
Post a Comment