PHPackages                             fousky/jsblock - 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. [Templating &amp; Views](/categories/templating)
4. /
5. fousky/jsblock

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

fousky/jsblock
==============

Collect &amp; render javascripts at the end of your template.

4.3.0(6y ago)1691MITPHPPHP &gt;=7.2

Since Sep 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Fousky/JSBlockBundle)[ Packagist](https://packagist.org/packages/fousky/jsblock)[ RSS](/packages/fousky-jsblock/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

JSBlockBundle
=============

[](#jsblockbundle)

The Symfony JSBlockBundle gives you a chance to collect javascript across all **TWIG templates (e.g. forms)** and render them at the end of your layout (or anywhere you want them).

[![Build Status](https://camo.githubusercontent.com/1b85658db325490d4143f7a272d23277fd981a850943a41be23f5c0ae646c31c/68747470733a2f2f7472617669732d63692e6f72672f466f75736b792f4a53426c6f636b42756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Fousky/JSBlockBundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/619d5b57fe72837a2e740d733ee24b7a6cac7d7df011756ffae56389a57ec6c6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466f75736b792f4a53426c6f636b42756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Fousky/JSBlockBundle/?branch=master)

#### 1. Install it by composer

[](#1-install-it-by-composer)

```
composer require fousky/jsblock

```

#### 2. Register bundle in Kernel

[](#2-register-bundle-in-kernel)

```
public function registerBundles()
{
    $bundles = array(
        new Fousky\JSBlockBundle\FouskyJSBlockBundle(),
        // ... your custom bundles
    );

    // ... your custom dev bundles

    return $bundles;
}
```

#### 3. Render collected javascripts to your main template

[](#3-render-collected-javascripts-to-your-main-template)

I assume you have the main template `layout.html.twig`, so add `{% jsblock 'render' %}` before closing `` tag.

Of course you can put this tag anywhere you want to render collected javascripts.

```

    my page

{% jsblock 'render' %}

```

#### 4. Collect javascripts anywhere

[](#4-collect-javascripts-anywhere)

Now you can collect javascripts anywhere you want. You have to start collecting by tag: `{% jsblock 'start' %}` and close it by tag `{% jsblock 'stop' %}`.

```

{% jsblock 'start' %}

        $(document).ready(function() {
            console.log('Hello from collected JSBlockBundle!');
        });

{% jsblock 'stop' %}

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~202 days

Recently: every ~259 days

Total

7

Last Release

2309d ago

Major Versions

1.0.1 → 2.0.02017-03-19

2.0.0 → 3.0.02017-06-16

3.0.0 → 4.0.02019-02-23

PHP version history (3 changes)1.0.0PHP &gt;=5.3.9

3.0.0PHP &gt;=7

4.2.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

[![kockodev](https://avatars.githubusercontent.com/u/10545057?v=4)](https://github.com/kockodev "kockodev (1 commits)")

---

Tags

twig-extension

### Embed Badge

![Health badge](/badges/fousky-jsblock/health.svg)

```
[![Health](https://phpackages.com/badges/fousky-jsblock/health.svg)](https://phpackages.com/packages/fousky-jsblock)
```

###  Alternatives

[bes/mobiledetect-twig-extension

MobileDetect-integration for Twig

18237.3k](/packages/bes-mobiledetect-twig-extension)[dms/twig-extension-bundle

DMS Twig Extension Bundle, leverages Fabien Potencier's extra twig extensions for your website.

19296.3k](/packages/dms-twig-extension-bundle)[bluetel-solutions/twig-truncate-extension

Twig Extension to truncate nested HTML, safely!

11100.0k](/packages/bluetel-solutions-twig-truncate-extension)

PHPackages © 2026

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