Changing getArrayResult() to getArray() fixes weird Symfony Doctrine gotcha

A strange Symfony Doctrine issue got me the other day.  I guess it's a lack of clear understanding of how Doctrine hydrates database query results when using getArrayResult() instead of getArray().  It seems that getArrayResult() returns just the first record from your query, no matter how many records the query actually returns but getArray() returns…

Re-authenticating users in Symfony’s FOS User Bundle automatically from other authentication and separate user login systems

Let's say your website uses Symfony's "Friends of Symfony" FOS User Bundle but you also have different internal systems and other ways users can authenticate.  You don't want to keep pestering the user to log back in, the better solution is to get your authentication system that's outside the FOS User Bundle to talk to…

Symfony framework resources for security bundle and managing user logins

Go in depth with your security.yml file!  Doesn't that sound like fun?! Sensio Lab's Symfony has a great reference to help developers determine the best settings to properly set up security and login behaviors, like where to redirect users after a successful login, etc: Security Bundle Configuration How to customize your form login   Click…

For new Linux server installs, don’t forget to install the CURL library before installing Symfony or WordPress

Don't forget to install CURL after installing PHP. The Symfony PHP framework needs it, Wordpress needs it. Most websites running PHP need CURL. I find something will need it and if your website is going to talk to other websites, you're probably going to need CURL. Just make it a habit before rebooting after you…

Show all flash bag contents in Symfony Twig view

Here is a how you can display all your flash bag messages in a Symfony Twig view.  The "flash bag" is a special collection of session variables that hold data like a one-time message in HTML.  It is often used in e-commerce form flows when the credit card was declined, instead of further processing the…