PHPackages                             teameh/silex-react-renderer-provider - 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. teameh/silex-react-renderer-provider

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

teameh/silex-react-renderer-provider
====================================

Client and Server-side react rendering as a Silex service provider

v0.14.0(8y ago)334MITPHPPHP &gt;=5.5.0

Since Apr 11Pushed 8y ago2 watchersCompare

[ Source](https://github.com/teameh/silex-react-renderer-provider)[ Packagist](https://packagist.org/packages/teameh/silex-react-renderer-provider)[ Docs](https://github.com/teameh/silex-react-renderer-provider)[ RSS](/packages/teameh-silex-react-renderer-provider/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Silex React Renderer Service Provider
=====================================

[](#silex-react-renderer-service-provider)

**WARNING**: Silex and this project are not maintained any more. Ends of life of Silex is set to June 2018.

Read more on [Symfony's blog](https://symfony.com/blog/the-end-of-silex).

ReactRenderer
=============

[](#reactrenderer)

This provider integrates [ReactRenderer](https://github.com/Limenius/ReactRenderer) in your Silex project. This lets you implement your frontend with React.js and let php do the server-side rendering, allowing the development of universal (isomorphic) applications.

See  for full documentation on the renderer.

Usage
=====

[](#usage)

Basic example

```
$app = new Silex\Application();
$app->register(new Teameh\Silex\Services\React\ReactRendererServiceProvider(), [
    'react.serverside_rendering' => [
        // using phpexecjs:
        'server_bundle_path' => __DIR__ . '/path/to/your/javascript/development/bundle.js'
        // or using and external render server:
        // 'socket_server_path' => 'unix://node.sock'
    ]
]);
```

All config options

```
$app = new Silex\Application();

$app->register(new Teameh\Silex\Services\React\ReactRendererServiceProvider(), [
    'react.default_rendering' => $app['debug'] ? 'client_side' : 'both',
    'react.serverside_rendering' => [
        'fail_loud' => $app['debug'],
        'trace' => $app['debug'],
        'mode' => 'phpexecjs',
        // using phpexecjs:
        'server_bundle_path' => __DIR__ . '/path/to/your/javascript/development/bundle.js',
        // or using and external render server:
        // 'socket_server_path' => 'unix://node.sock',
        'logger' => $app['monolog'],
    ]
]);
```

Configuration options:

```
react.default_rendering:      string, either 'client_side', 'server_side' or 'both'

react.serverside_rendering:
    fail_loud                   bool, defaults to $app['debug']
                                  In case of error in server-side rendering, throw exception

    trace                       bool, defaults to $app['debug']
                                  Replay every console.log message produced during server-side rendering in the
                                  JavaScript console. Note that if enabled it will throw a (harmless) React warning

    mode                        string
                                  Mode can be `"phpexecjs"` (to execute Js from PHP using PhpExecJs),
                                  or `"external"` (to rely on an external node.js server) Default is `"phpexecjs"`

    string server_bundle_path   string (Only used with mode `phpexecjs`)
                                  Location of the server bundle, that contains the concatenated javascript bundle.
                                  This bundle should contain the ReactOnRails.register() code

    socket_server_path          string (Only used with mode `external`)
                                  Location of the socket to communicate with a dummy node.js server.
                                  Socket type must be acceptable by php function stream_socket_client.
                                  Example unix://node.sock, tcp://127.0.0.1:5000
                                  More info: http://php.net/manual/en/function.stream-socket-client.php
                                  Example of node server:
                                  https://github.com/Limenius/symfony-react-sandbox/blob/master/app/Resources/node-server/server.js

    logger                      \Psr\Log\LoggerInterface
                                  Logger used for errors

```

Rendering can be overridden on component basis, see

Credits
=======

[](#credits)

This project is a Silex adaption of [Nacho Martín's](https://github.com/nacmartin) great [ReactBundle](https://github.com/Limenius/ReactBundle).

Both ReactBundle and this provider build on top of [React On Rails](https://github.com/shakacode/react_on_rails), and uses [`react-on-rails`](https://www.npmjs.com/package/react-on-rails) to render React components. Don't worry you don't need and won't see any Ruby when using this package.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

3279d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1330668?v=4)[Teameh](/maintainers/teameh)[@teameh](https://github.com/teameh)

---

Tags

twigsilexreactreactjsisomorphic

### Embed Badge

![Health badge](/badges/teameh-silex-react-renderer-provider/health.svg)

```
[![Health](https://phpackages.com/badges/teameh-silex-react-renderer-provider/health.svg)](https://phpackages.com/packages/teameh-silex-react-renderer-provider)
```

###  Alternatives

[limenius/react-renderer

Client and Server-side React rendering

2431.2M6](/packages/limenius-react-renderer)[symfony/ux-twig-component

Twig components for Symfony

22017.2M313](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1636.5M116](/packages/symfony-ux-live-component)[alexk/craft-react

Client and Server-side React rendering for CraftCMS

444.5k1](/packages/alexk-craft-react)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

1682.8k1](/packages/symfony-ux-toolkit)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

261.9k](/packages/mati365-ckeditor5-symfony)

PHPackages © 2026

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