PHPackages                             flintci/jquery-ujs-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. [Security](/categories/security)
4. /
5. flintci/jquery-ujs-bundle

ActiveSymfony-bundle[Security](/categories/security)

flintci/jquery-ujs-bundle
=========================

Symfony bundle adapter for jQuery-ujs and CSRF protection

v0.1.0(8y ago)091MITPHPPHP ^7.1

Since Feb 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/flintci/jquery-ujs-bundle)[ Packagist](https://packagist.org/packages/flintci/jquery-ujs-bundle)[ RSS](/packages/flintci-jquery-ujs-bundle/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

jQuery UJS bundle
=================

[](#jquery-ujs-bundle)

Symfony bundle adapter for [jQuery-ujs](https://github.com/rails/jquery-ujs) and CSRF protection.

[![Latest Stable Version](https://camo.githubusercontent.com/5dd1149907e5a0447ca5a3ed54c18b782af6aa97d06621df8a0dbd0e5ea392b7/68747470733a2f2f706f7365722e707567782e6f72672f666c696e7463692f6a71756572792d756a732d62756e646c652f762f737461626c65)](https://packagist.org/packages/flintci/jquery-ujs-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/8796f990d3ceb93e24a868ae2d643e0bfb263996ec2869d5bd615499b53f9369/68747470733a2f2f706f7365722e707567782e6f72672f666c696e7463692f6a71756572792d756a732d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/flintci/jquery-ujs-bundle)[![License](https://camo.githubusercontent.com/eaa5243be821b7096288f5c22812ad4bd564acfd9b6b156d7e4fceae94aab280/68747470733a2f2f706f7365722e707567782e6f72672f666c696e7463692f6a71756572792d756a732d62756e646c652f6c6963656e7365)](https://packagist.org/packages/flintci/jquery-ujs-bundle)

[![Total Downloads](https://camo.githubusercontent.com/0a2804d90973df11f1845e532b0fd21d8706c7ae602e56097ac84f6c074516a3/68747470733a2f2f706f7365722e707567782e6f72672f666c696e7463692f6a71756572792d756a732d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/flintci/jquery-ujs-bundle)[![Monthly Downloads](https://camo.githubusercontent.com/04ed41985f6ff33ccd673dec935b25b74c5ce44f8a0953712da9782e61e23aed/68747470733a2f2f706f7365722e707567782e6f72672f666c696e7463692f6a71756572792d756a732d62756e646c652f642f6d6f6e74686c79)](https://packagist.org/packages/flintci/jquery-ujs-bundle)[![Daily Downloads](https://camo.githubusercontent.com/596469cf1ae0295128667186dccd2c764cdbf23b51f9a8696d7d439dd05a2e75/68747470733a2f2f706f7365722e707567782e6f72672f666c696e7463692f6a71756572792d756a732d62756e646c652f642f6461696c79)](https://packagist.org/packages/flintci/jquery-ujs-bundle)

[![Build Status](https://camo.githubusercontent.com/d158ecbe9c5d409dc103fb925565e9f17dbbd325a44de78013317b0b7efa2625/68747470733a2f2f7472617669732d63692e6f72672f666c696e7463692f6a71756572792d756a732d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/flintci/jquery-ujs-bundle)[![Coverage Status](https://camo.githubusercontent.com/0db1975d19044dc28826134e77337c2233b2d8d989982909419f43199b755092/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f666c696e7463692f6a71756572792d756a732d62756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/flintci/jquery-ujs-bundle?branch=master)

Installation
------------

[](#installation)

Install the bundle with composer:

```
composer require flintci/jquery-ujs-bundle
```

Configuration
-------------

[](#configuration)

Enable the bundle. It is already done if you use Symfony Flex.

```
// config/bundles.php

return [
    FlintCI\jQueryUJSBundle\FlintCIjQueryUJSBundle::class => ['all' => true],
];
```

Add the `metas.html.twig` template file on the `` part:

```
{# base.html.twig #}

        {% include '@FlintCIjQueryUJS/metas.html.twig' %}

    {# ... #}

```

Finally, install jquery-ujs with [Yarn](https://yarnpkg.com/en/package/jquery-ujs)or [NPM](https://www.npmjs.com/package/jquery-ujs)and include the [rails.js](https://github.com/rails/jquery-ujs/blob/master/src/rails.js) file.

Example on a `app.js` file using WebPack:

```
import 'jquery-ujs';
```

Then, you are good to go!

Usage
-----

[](#usage)

Start using jquery-ujs by writing this special link:

```

```

Then you can manually verify the CSRF validity on the controller:

```
namespace App\Controller;

use FlintCI\jQueryUJSBundle\Security\Csrf\UjsCsrfManager;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;

/**
 * @Route("/account")
 */
final class AccountController extends Controller
{
    /**
     * @Route("/")
     * @Method("DELETE")
     */
    public function deleteAction(UjsCsrfManager $ujsCsrfManager): Response
    {
        if (!$ujsCsrfManager->isTokenValid()) {
            throw new BadRequestHttpException('Invalid token.');
        }

        // ...
    }
}
```

Or directly with the annotation:

```
namespace App\Controller;

use FlintCI\jQueryUJSBundle\Annotations\UjsCsrf;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

/**
 * @Route("/account")
 */
final class AccountController extends Controller
{
    /**
     * @Route("/")
     * @Method("DELETE")
     * @UjsCsrf
     */
    public function deleteAction(): Response
    {
        // Nothing to check here. A bad request excpetion will be thrown if the token is invalid.
    }
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3027d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/flintci-jquery-ujs-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/flintci-jquery-ujs-bundle/health.svg)](https://phpackages.com/packages/flintci-jquery-ujs-bundle)
```

###  Alternatives

[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[tilleuls/url-signer-bundle

Create and validate signed URLs with a limited lifetime in Symfony

81340.1k](/packages/tilleuls-url-signer-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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