Symfony Twig: Accessing global values reference

Here is a reference list to access global values within Twig: For more Symfony Twig shortcuts, view the Twig Cheatsheet with recent updates added, a perfect reference for Symfony web developers.

Symfony: Forcing redirects in controller and specifying redirect type

The Symfony documentation is getting better, but it still lacks more detail, which is why I've been collecting helpful tips and snippets here.  According to the Symfony docs, by default, the " method performs a 302 (temporary) redirect, so in order to specify a 301 (permanent) redirect, you can add the third argument in this…

In Symfony, moving some code from one bundle to another a simple way to modularize your code, reuse and scale. Oh yeah!

I recently ran into an issue where I found I was creating a new user profile system for different systems and then it occurred to my:  DRY.  DON'T REPEAT YOURSELF.  Yet, in the bustle of activity I realized there was too much in common with these user profiles to rewrite the code. So why not…

Check if Symfony PHP session has been started

Here's how you can check if a session in Symfony was started: Not a big fan of session variables, but used for non-sensitive session data, I think sessions are still useful.  After all, if you only want certain behaviors on your website tailored to a customer apply only while their browser is open on…

Latest Symfony Composer dependency list for bootstrapping new Symfony bundle with most common bundles

Most Symfony sites you develop will probably include the FOS User Bundle, Twitter Bootstrap, and JQuery.  You can always remove them from your Composer dependency list, but here is my latest "Symfony Bootstrap" install. A few issues with dependencies in your Composer are expected, I ran into this error while installing the Sonata Admin Bundle,…