Forest header image

Symfony Finland
Random things on PHP, Symfony and web development

Overview for react

Sharing state in a Symfony hybrid with Twig, React & any JavaScript/PHP apps

Front end development has certainly grown up in the last few years. UI logic is increasingly being moved to the client side, but the traditional server-rendered views aren't going anywhere soon. And they shouldn't.

The two methods will live alongside each other and you'll have to work with two worlds. Let's explore an idea how to make this pleasant to work with, by sharing state between Twig templates and JavaScript.


Written by Jani Tarvainen on Wednesday January 25, 2017
Permalink - Tags: php, javascript, react, typescript

Testing React.js isomorphic rendering with php-v8js and the Symfony Microkernel

React.js is often thought of as as a front end technology. They can, however be rendered on the server side too - using JavaScript. This naturally turns the scale towards Node.js, but PHP with the v8js installation can handle it too.

Let's see how to merge together v8js and the Symfony Microkernel, making it possible to set the initial state of server rendered components using a PHP backend.


Written by Jani Tarvainen on Saturday December 19, 2015
Permalink - Tags: react, javascript, v8, v8js, php, symfony

Introduction to React.js Components and Server Side Rendering in PHP

React is an interface library that is rapidly gaining ground. It can be considered as similar to what Angular and Ember, for example, are. As opposed to Angular and Ember React.js focuses on User Interfaces alone, being neutral on routing and other duties. React can also be rendered on the server side, which is not unique - but very natural to it.


Written by Jani Tarvainen on Sunday December 13, 2015
Permalink - Tags: react, php, node, javascript