Enter some keywords

Use Swiftmailer Spooling While Having Instant FOSUserBundle Emailing in Symfony 2.0

I had a case where I needed to use the spooling feature of swiftmailer, which is integrated into Symfony 2.0, a php framework. Unfortunately, when I changed my configuration to spool my emails, registation emails and lost password emails would not be s...

The Best Symfony 2.0 Bundles

I have only been using Symfony 2 for about 6 months now, and I have not have enough time to use very many additional bundle for Symfony. However all of the bundle that I have tested have been of superb quality.

With my limited experience, the...

How to Define GET variables for Twig 'path()' in Symfony 2.0

This is a quick example of how to set a get variable through path(), in Twig.

In most examples I have seen online, most people will show examples of how to use 'path' in Symfony2, but only using slugs in the routing.

The Solution:

Optimizing ElasticaBundle Indexing

This article is going to cover how to make elasticabundle index items MUCH faster than by default. Before I made these changes, I got maybe 10-20 items to index a second. Afterwards, I was indexing about 2000 a second. So this is a HUGE improvement.

Create 404 Error in Symfony 2.0

Here is an example of how to forward someone to a 404 error page in Symfony 2.0.

How to create a 404 Error

Inside of the controller include:

throw $this->createNotFoundException('That id does not ex...

Set Limit When Using createQuery in Symfony 2.0

To set the limit when using entitymanager->createQuery() is easy. Instead of trying to use something to the effect of "LIMIT 0,1000" on the end of your query, try ->setMaxResults(1000) on your query object.

$em = $this->g...

Simple File Upload Example Symfony2.0

Tip 1
Your form must be POST, and have enctype="multipart/form-data"
<form method="POST" action="" enctype="multipart/form-data">
<input type="file" name="file" /><br />
<input type="...