Rendering templates from a Twig extension

Given you need to render something - a toolbar for example - inside your template in a Symfony application. You have some options to do this like creating a specific controller action. Embedding a controller action is already described thoroughly in the Symfony docs and seems to be the most legit answer on this topic in multiple StackOverflow questions.
But there is another option; creating a Twig extension which facilitates a function to render your template. How to create such extension you ask? In this blog post I'll explain how.

A spelling and grammar checker for Node

When you need to write in a foreign language, you'll probably use Google Translate. An awesome service that does a great job for translating individual words. But what about the grammar of a sentence? Like for example 'Edwards will be sck yesterday'. It will corrects 'sck' to 'sick', but it doesn't correct 'will be' to 'was'.
Thankfully there are some other services for that and I created a Node wrapper for one of them. Say hello to Gingerbread.

Handle authenticated users in Behat/Mink

One of the latest addition to PHP's testing tools is Behat. A test framework that focusses on business expectations (behavior driven development) versus the good ol' unit tests of PHPUnit (test driven development). In short, with BDD you are describing your functionality instead of testing your functionality with TDD afterwards.
If you use Behat in combination with Mink, you can test the behaviour of your application in the browser. It simulates the interaction between users and your application. But what if you have any authentication mechanism in your application, do you need to go through the login form in any test? The answer is no. And in this article I'll explain how.

Mock Guzzle responses in Symfony tests

Most of the web applications out there have at least one integration with an external service. Like with Twitter for pulling in tweets for example. On the other hand, most of the web applications have (or should have) functional testing setup to be less error prone when deploying new releases. You want these tests to be executed as quick as possible and test every possible scenario that could happen with your external service integration.

I had the same with my Twitter integration (the latest tweet bar on top of this site). These are fetched with the brilliant Guzzle library and luckily they came up with functionality to mock up responses. I'll show you how to do it in Symfony.