PHPackages                             skrip42/static-collector-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. skrip42/static-collector-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

skrip42/static-collector-bundle
===============================

add static collector for control you static!

v2.0.3(5y ago)227MITPHPPHP ^7.1

Since Apr 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Skrip42/StaticCollectorBundle)[ Packagist](https://packagist.org/packages/skrip42/static-collector-bundle)[ Docs](https://github.com/skrip42/StaticCollectorBundle)[ RSS](/packages/skrip42-static-collector-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (4)Versions (5)Used By (0)

symfony bundle that simplifies the work with statics

premise:
--------

[](#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:
-------------

[](#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:
--------

[](#install)

```
composer require Skrip42/static-collector-bundle

```

usage:
------

[](#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:

```

        {% block title %}PonBase{% endblock %} - PonBase

        {% static_place 'style' %}

        ...
        {% static_place 'script' %}

```

- now you can connect statics in any template you use

```
{% block custom_input_for_example %}
  ...
  {% static 'some_webpack_asset' %}
  {% static 'https://external.com/script.js?may_have=parameters' %}
  {% static 'https://external.com/style.css?may_have=parameters' %}
{% endblock %}
```

advanced:
---------

[](#advanced)

### static type

[](#static-type)

you can specify which statics should be placed (styles, scripts or all)

```
    {% static_place 'style' %}
    {% static_place 'script' %}
    {% static_place 'all' %}
```

### static order control

[](#static-order-control)

you can define the order of connecting statics, specifying it manually

```
  {% static 'some_important_static' order 0 %}
```

the order number must be any integer. By default all statics have the order number 1000

### division static into group

[](#division-static-into-group)

you can mark statics as belonging to some group

```
  {% static 'some_static' group 'some_group' %}

  ...

  {% static_place all group 'some_group' %}
```

by default all statics are placed in the "default" group

### work with static from php

[](#work-with-static-from-php)

you can connect and receive statics from your php code:

```
namespace App\Some;

use Skrip42\Bundle\StaticCollectorBunde\StaticCollector;

class SomeClass
{
    public function someMethod(StaticCollector $staticCollector)
    {
        //you can add some static to collector
        $staticCollector->addStatic('webpack_asset_or_external_link');
        //you can get style and script from staticCollector
        $staticCollector->getStyleTags();
        $staticCollector->getScriptTags();
        //you can remove all static from staticCollector
        $staticCollector->clear();
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

4

Last Release

1849d ago

Major Versions

v1.0.0 → v2.0.02021-04-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac2ab44421653cebc795140356530287c37ba8c2011790683db6d2b316ea0e8d?d=identicon)[skrip42](/maintainers/skrip42)

---

Top Contributors

[![Skrip42](https://avatars.githubusercontent.com/u/11675343?v=4)](https://github.com/Skrip42 "Skrip42 (13 commits)")

### Embed Badge

![Health badge](/badges/skrip42-static-collector-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/skrip42-static-collector-bundle/health.svg)](https://phpackages.com/packages/skrip42-static-collector-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[wallabag/wallabag

open source self hostable read-it-later web application

12.6k2.2k](/packages/wallabag-wallabag)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[maba/webpack-bundle

Bundle to Integrate Webpack to Symfony

123268.2k4](/packages/maba-webpack-bundle)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
