Skip to main content

22 posts tagged with "symfony"

View All Tags

Silex, Twig and Translation support

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

As I have written a couple of days ago, we are using Silex and Twig to build a small application for one of our customers. Since the project was in need of I18N support, we set up the TranslationServiceProvider with the Symfony/Translation component as the Silex documentation advised. Unfortunately I was not able to find a Twig extension allowing us to translate static content within a Twig template, so it was the time to jump in and develop an extension on my own and publish it on github. Simply drop the files in your vendors directory and include the lib/bitExpert/Silex/Autoloader.php file within your application and execute the steps listed below:

Silex and the TranslationServiceProvider and some Composer magic

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

First time I am toying with Silex and the Symfony components. To demo an application for one of our customers we quickly set-up Silex and put a small application on top. Since the application was in need for a I18N solution I threw in the TranslationServiceProvider. The documentation of Silex states that "you can simply clone the whole Symfony2 into vendor" which did not make any sense to me. Why using a micro-framework when I have to have Symfony2 installed just for the translation part? I was looking for a alternative and remembered Composer. Composer is a tool written in PHP that helps you manage your project or libraries' dependencies. Luckily the Symfony2 components are using Composer, so we can easily install the required dependencies like this: