Tag Archives: php

A Symfony Developer’s tips, tricks and hacks: How we get the most out of our tools

A lot of the tools I use on a day-to-day basis as a Symfony developer at White October are well-known and widely-used by others.  What other people may not know, however, are the tips, tricks and hacks that I and my team use to get the most out of them. This article explores a few […]

How to test UTF-8 email subject lines in Symfony

One of our clients needs to send emails with UTF-8 subject lines. Swift Mailer, which Symfony uses, makes this easy to do, but writing functional tests for it is another story.

Stored functions with Symfony and Doctrine

A Symfony project I’m working on currently requires a couple of MySQL stored functions to be available. In the interests of making the code I write reusable in future, some of it has been moved into a plugin, but this code relies on a couple of stored functions being available.

Simple shorten url using bit.ly and php

Inspired by the simple tweet to twitter function by Fabian Potencier I have built a stupidly simple url shorter for bit.ly. Something you are probably going to want to do if you are sending tweets via PHP. function shorten($url, $login, $apikey) { $api_url = “http://api.bit.ly/shorten?version=2.0.1& longUrl=”.urlencode($url).”&login=”.$login.”& apiKey=”.$apikey; $ret = file_get_contents($api_url); $data = json_decode($ret); if($data instanceof […]

Don’t be afraid to NOT use the ORM…

I’ve been racking my brains the past couple of days with a Doctrine issue within a Symfony project. I was constructing a bank statement-esque page, which iterated over a “StatementEntry” table and displayed the results. Entries could either be of model Type A or model Type B, with the relevant model ID stored in the […]

“Why I hate Criteria”

Nicking the title from the previous post, oh and the sentiment. I don’t hate Criteria**, it is actually quite good, however watching the video in the previous post reminded me of a few issues we have had in the office where we have complained about it or just got plain confused… I know Dan, for […]

Ready to talk?

Whether you want to create a new digital product or make an existing one even better, we'd love to talk it through.

Get in touch