Download the PHP package skrip42/static-collector-bundle without Composer
On this page you can find all versions of the php package skrip42/static-collector-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download skrip42/static-collector-bundle
More information about skrip42/static-collector-bundle
Files in skrip42/static-collector-bundle
Package static-collector-bundle
Short Description add static collector for control you static!
License MIT
Homepage https://github.com/skrip42/StaticCollectorBundle
Informations about the package static-collector-bundle
symfony bundle that simplifies the work with statics
premise:
Often your included widgets or custom form UI elements need their own styles and scripts. The standard statics connection system offers 3 options for their connection:
- include statics in the template of a included widget or form element, which leads to duplicates and "splashing" of static across your final html
- include all static in the constructor template, which makes control more difficult and violates the dependency principle
- include all the statics in the base template, which leads to an unjustified increase in the size of the loaded statics and also violates the principle of dependencies
this bundle offers an alternative without these disadvantages
how in works:
The StaticCollector is a global storage. During template execution, scripts, styles and assets are registered in the StaticsCollector. After the template is compiled into html, the statics collector places the statics in the marked places
install:
usage:
-
just put "{% static_place 'script' %}" and "{% static_place 'style' %}" tags in your base template where you want to see your included scripts and styles:
- now you can connect statics in any template you use
advanced:
static type
you can specify which statics should be placed (styles, scripts or all)
static order control
you can define the order of connecting statics, specifying it manually
the order number must be any integer. By default all statics have the order number 1000
division static into group
you can mark statics as belonging to some group
by default all statics are placed in the "default" group
work with static from php
you can connect and receive statics from your php code:
All versions of static-collector-bundle with dependencies
symfony/webpack-encore-bundle Version ^1.7
twig/twig Version ^2.12|^3.0
symfony/twig-bundle Version 5.*
skrip42/twig-postprocessor-bundle Version ^1.0.0