symfony - AsseticBundle Configuration - Explaination -


there no real detail in documentation asseticbundle config - in config.yml.

assetic:     debug:                "%kernel.debug%"     use_controller:         enabled:              "%kernel.debug%"         profiler:             false     read_from:            "%kernel.root_dir%/../web"     write_to:             "%assetic.read_from%"     java:                 /usr/bin/java     node:                 /usr/bin/node     ruby:                 /usr/bin/ruby     sass:                 /usr/bin/sass     # key-value pair of number of named elements     variables:         some_name:                 []     bundles:          # defaults (all registered bundles):         - frameworkbundle         - securitybundle         - twigbundle         - monologbundle         - swiftmailerbundle         - doctrinebundle         - asseticbundle         - ...     assets:         # array of named assets (e.g. some_asset, some_other_asset)         some_asset:             inputs:               []             filters:              []             options:                 # key-value array of options , values                 some_option_name: []     filters:          # array of named filters (e.g. some_filter, some_other_filter)         some_filter:                 []     workers:         # see https://github.com/symfony/asseticbundle/pull/119         # cache can busted via framework.templating.assets_version         # setting - see "framework" configuration section         cache_busting:             enabled:              false     twig:         functions:             # array of named functions (e.g. some_function, some_other_function)             some_function:                 [] 

i'm specially interested in

 read_from:    don't understand path,     write_to:     

because don't understand how use it.

so, want use scss , compass , have folder in appbundle/resources/assets/styles/main.scss

what have setup in config.yml, assetic know how find main.scss global setting?

unless trying update directory assetic reads/writes (thus being /web default), don't need change here. configuration can understood part on symfony documentation. you'll find need in:

read_from:            "%kernel.root_dir%/../web" write_to:             "%assetic.read_from%" 

these paths directory writable/readable, , exposed public. in case, means /path/to/app/../web both readings , writings.

in general manner, check php app/console config:dump-reference x find default configuration of given bundle, x bundle config name. in case, try later: php app/console config:dump-reference assetic

now, want use compass/sass view far can see. in twig file, put following:

{% stylesheets 'path/to/main.scss' filter='compass' %}     <link rel="stylesheet" type="text/css" href="{{ asset_url }}"> {% endstylesheets %} 

after adding configuration compass if needs tweaked, should set.

is helping? not, please provide more details?


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -