What are the advantages and disadvantages of using Symfony 2 as an alternative framework to Joomla for web development projects?

Symfony 2 offers more flexibility and control over the development process compared to Joomla, making it a better choice for complex web development projects. However, Symfony 2 requires more technical expertise and time to set up and configure compared to Joomla, which may not be suitable for beginners or small projects.

// Symfony 2 code example
use Symfony\Component\HttpFoundation\Response;

public function indexAction()
{
    return new Response('Hello, Symfony 2!');
}