Header image

Symfony Finland
Random things on PHP, Symfony and web development

AMP theme for Twig and Symfony

AMP, the Accelerated Mobile Pages is an alternative markup to traditional HTML. Released in October 2015, the technology continues to gain popularity. In 2018 content driven sites should definitely look into integrating AMP markup views for optimal load times and SEO.


Written by Jani Tarvainen on Sunday December 10, 2017
Permalink -

Adding a GraphQL API to your Symfony Flex application

I've been using GraphQL for some API thingamajigs, and it's been working fine. Now with Symfony 4 out, I figured a write-up on how to use GraphQL with Symfony Flex could be useful for someone.

We'll expand on a previous demo app that I built. That app already uses Doctrine ORM as storage, so let's bridge that to a GraphQL API.


Written by Jani Tarvainen on Wednesday November 29, 2017
Permalink -

Four things I like about Symfony 4

Symfony 4 launches on November 30th 2017, some two years after the previous major release that was Symfony 3. Symfony 3 can be thought of as a stabilisation release with code cleanup, some new functionality and housekeeping Standard Edition (AKA Full Stack Framework).

In the latest incarnation there are more significant changes, especially to the framework and some key components. Let's take a look at four features that address frustrations that I've had in the past.


Written by Jani Tarvainen on Monday November 27, 2017
Permalink -

State of GraphQL PHP libraries and Symfony integrations in 2017

GraphQL has continued to gain momentum over the course of 2017. While it's certainly not a replacement for REST in all cases, it does provide consumers of Content APIs, etc. better ergonomics than general purpose RESTful interfaces. For PHP there are currently two popular libraries, both of which have Symfony integration Bundles.


Written by Jani Tarvainen on Monday November 13, 2017
Permalink -

Attaching React.js to a template rendered on the server with Twig

React.js is a JavaScript view library that allows developers to create interfaces is a structured way based on a hierarchical component structure. React can either create the DOM structure from scratch, or attach to an existing one rendered by the server to speed up first load.

If you create Twig templates that match the React rendering, you can take advantage of this feature without a complicated rendering setup.


Written by Jani Tarvainen on Sunday November 12, 2017
Permalink -

Symfony Flex adoption picks up prior to release of 4.0 in November 2017

With Symfony 4.0 a new standard structure for building applications is being adopted. This is known as Symfony Flex and will be the preferred way of creating applications. Symfony 4.0 is scheduled for release in November 2017, but many projects have already started adopting the new structure.


Written by Jani Tarvainen on Tuesday October 31, 2017
Permalink -

Running Symfony without a web server on Docker using PHP-PM

Docker containers have been becoming an increasingly common deployment method in the past few years. I've deployed some Node.js app in containers, which are very simple to deploy as there's a single process that's easy to run. I found running PHP to be more complex.


Written by Jani Tarvainen on Sunday October 22, 2017
Permalink -

PHP 7.1 vs 7.2 Benchmarks (with Docker and Symfony Flex)

PHP 7.2 will be launching soon, in fact it has already reached Release Candidate status. I was exploring Symfony Flex with Docker setup and thought I would do a quick round of tests to compare the differences in PHP 7.1 and 7.2 (RC4) regarding performance with a few benchmarks.


Written by Jani Tarvainen on Saturday October 14, 2017
Permalink -

Drop-dead simple SASS builds in Symfony Flex with Webpack Encore

Symfony Encore is a wrapper for the JavaScript module bundler Webpack. Webpack is used to manage Front End assets like JavaScript, CSS and image for browser consumption, often with conversion step from a source format like SASS. Encore provides an opinionated way to add Webpack to your Symfony projects.


Written by Jani Tarvainen on Saturday July 8, 2017
Permalink -

Porting a Symfony 3 application to Flex

Earlier this year I did some experimenting with a Hybrid state object between Symfony Twig templates and front end JavaScript frameworks. Since that time I did that experiment, the Symfony Flex project has progressed. I thought I would try how to port the state prototype to Symfony Flex.


Written by Jani Tarvainen on Friday June 23, 2017
Permalink -

My Symfony translations workflow in 2017

Translations continue to be a challenging topic in web applications. There are many methods, formats and terms for translating. While Symfony has quite a good set of translation tools, there are many formats and some gotchas that are easy to forget if you don't have a routine.

Let's take a look at a workflow that has worked for me with Symfony app localizations in 2017.


Written by Jani Tarvainen on Sunday April 9, 2017
Permalink -

A practical introduction to TypeScript for PHP developers

Most developers I know should be classified with the trendy word polyglot. Polyglot means a person that speaks multiple languages, where as for developers they're programming languages. Even if you consider yourself as a PHP developer, you're likely more diverse.

Programming languages rise and fall in relevance, so your skillset and routine varies over time - depending on trends as well as the line of work you're in. Let's take a practical look at why you might find TypeScript a worthy language to use in 2017 and beyond.


Written by Jani Tarvainen on Sunday February 5, 2017
Permalink - Tags: php, typescript, javascript

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

Full Stack Symfony B2B eCommerce suite OroCommerce released

eCommerce is one of areas of web development where quality and reliability directly affects your bottom line. This is probably one of the reasons many eCommerce software vendors have adopted Symfony. OroCommerce is one of them has reached a 1.0 release.


Written by Jani Tarvainen on Thursday January 19, 2017
Permalink -

Lesser known Symfony eCommerce projects: WellCommerce and ONGR

Symfony is a significant effort in itself, but because it offers a stable platform for other project to build on - many know Symfony through other high profile projects like Laravel or Magento. But these well known projects are only a tip of the iceberg. Some interesting options utilising Symfony are WellCommerce and the ONGR projects.


Written by Jani Tarvainen on Sunday December 18, 2016
Permalink -

PHP 7.1 vs. 7.0 performance benchmarks with Symfony

PHP 7.1 was launched on December 1st 2016. This was the first minor release after the release of 7.0 a year ago. PHP 7.0 was a revolutionary product, especially when it comes to memory usage and performance. PHP 7.1 is a more modest upgrade that brings new features and improved performance. But how much has performance improved from a year back?


Written by Jani Tarvainen on Friday December 9, 2016
Permalink -

Symfony Flex set to enable RAD (Rapid Application Development)

The Symfony project produces both decoupled components as well as a full stack PHP framework based on these components. The components have been a success with wide adoption and so has the framework, bringing structure that scales to enterprise complexity.

What Symfony has been lacking is tooling for Rapid Application Development (RAD), with minimal overhead for prototyping, etc.


Written by Jani Tarvainen on Saturday December 3, 2016
Permalink -

Progress requires both stability and innovation, Symfony is nailing it

Web development is a relatively fast moving industry. Technologies come and go, and while many of them are definite improvements - some are fads that don't have a long shelf life. Perhaps the biggest underlying issue is that developers often don't even take the time to learn a particular technology before moving on to the next one.


Written by Jani Tarvainen on Tuesday November 29, 2016
Permalink -


What's in store for PHP performance?

PHP 7.0 made significant improvements in terms of performance and memory use for real applications. Many applications deliver twice the throughput with much less memory just without any changes to the application code.

But with networked API driven architectures individual response times are increasingly critical for end-user experience. Luckily, there are quite a few unbeaten paths for regarding PHP performance.


Written by Jani Tarvainen on Monday October 17, 2016
Permalink -