docplanner / assets-bundle
Installs: 149 398
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 71
Forks: 1
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- symfony/framework-bundle: ^2.8 || ^3.0 || ^4.0
- twig/twig: ^1.38 || ^2 || ^3
README
Sample config
docplanner_assets:
use_revisions: true
base_host: "www.example.com/platform/"
base_path: "%kernel.root_dir%/../web/platform/"
types:
style:
assets:
common: { src: "css/rwd-common.css" }
extra: { src: "css/rwd-extra.css" }
groups:
default:
assets:
- common
- extra
default: true
homepage:
assets:
- common
routes: [ "homepage" ]
script:
assets:
common: { src: "js/common.js" }
groups:
default:
assets:
- common
default: true
Sample use in twig
{% for style in assets_style() %}<link href="{{ style }}" rel="stylesheet" />{% endfor %}
<style type="text/css">{% for style in assets_style(true) %}{{ style }}{% endfor %}</style>
{% for script in assets_script() %}<script src="{{ script }}" type="text/javascript"></script>{% endfor %}
<script type="text/javascript">{% for script in assets_script(true) %}{{ script }}{% endfor %}</script>