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

ActivePhp[Templating &amp; Views](/categories/templating)

bigoen/mercure-twig-bundle
==========================

Mercure twig bundle.

v1.0.3(5y ago)3156LGPL-3.0PHPPHP &gt;=7.4

Since Dec 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bigoen/mercure-twig-bundle)[ Packagist](https://packagist.org/packages/bigoen/mercure-twig-bundle)[ RSS](/packages/bigoen-mercure-twig-bundle/feed)WikiDiscussions master Synced 1mo ago

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

Mercure Twig Bundle
===================

[](#mercure-twig-bundle)

Developed based on  package.

**Install:**

```
composer require bigoen/mercure-twig-bundle

```

**If you don't use Symfony Flex:**

.env.local

```
###> bigoen/mercure-twig-bundle ###
MERCURE_TWIG_PUBLISH_URL=http://mercure/.well-known/mercure
###< bigoen/mercure-twig-bundle ###
```

config/bundles.php

```
return [
    // ...
    Bigoen\MercureTwigBundle\BigoenMercureTwigBundle::class => ['all' => true],
];
```

config/packages/bigoen\_mercure\_twig.yaml

```
bigoen_mercure_twig:
    public_url: "%env(MERCURE_TWIG_PUBLISH_URL)%"
    # subscriber_js: '@BigoenMercureTwig\subscriber_js.html.twig'
```

How to use?
-----------

[](#how-to-use)

**Configurations:**

- Set MERCURE\_TWIG\_PUBLISH\_URL,
- Set subscriber\_js in yaml configuration. Default: '@BigoenMercureTwig\\subscriber\_js.html.twig'

**Publisher Example:**

```
use Symfony\Component\Mercure\PublisherInterface;
use Symfony\Component\Mercure\Update;

/** @var PublisherInterface $publisher */
$publisher(new Update('live', 'test'));
```

**Controller Example:**

```
