Questions tagged [symfony]

Symfony refers to both a PHP framework for building web applications as well as a set of components on which the framework is built. This tag refers to the currently supported major versions 3.x, 4.x, 5.x and 6.x. Alternatively, you can specify an exact version using the respective tag. This tag should not be used for questions about Symfony 1.x. Please use the Symfony1 tag instead.

Symfony is a framework for web and CLI-applications built on top of a catalogue of Symfony components. It is free software released under the MIT license. The project's homepage is symfony.com.

Symfony aims to speed up the creation and maintenance of web applications and replace repetitive coding tasks by providing a rich set of components and integrations for other libraries through bundles. It has a low-performance overhead used with a bytecode cache and is aimed at building robust applications in an enterprise context, and aims to give developers complete control over the configuration: from the directory structure to the foreign libraries. Almost everything can be customized. To match enterprise development guidelines, Symfony is bundled with additional tools to help developers test, debug and document projects. Most of the components making up the framework can be used outside of the framework in other projects and libraries.

Components

Besides being a full-stack framework, Symfony is also a set of decoupled and Components.

Some of the Components have their own tag:

Information

This tag should be used for generic Symfony questions. You can also use other tags when the question is related to a specific version: , , , , , , , , , , , , , , , , , , , and .

If your question is about Symfony 1.x, please use instead.

The latest stable version can be found on the releases page.

Symfony also maintains Long Term Support (LTS) releases, which are held for several years (while “normal” releases are only maintained for about eight to ten months). The Symfony team is committed to providing a direct upgrade path between Long Term Support releases.

Related projects

Symfony is used as a basis for many other projects, such as , or

Useful links

Note: Before using any documentation, verify that the version of the documentation matches the Symfony version of your installation.

Upgrade between each version:

Interesting questions:


Symfony is released under the MIT license. The full license text is available on the website.

73565 questions
13
votes
8 answers

SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Symfony2

I tried to create my DB with Symfony2 typing the command below: php app/console doctrine:create:database The result is: Could not create database for connection named jobeet SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost'…
mentaga
  • 131
  • 1
  • 1
  • 4
13
votes
1 answer

Twig render vs include - When and where to use one or the other?

I've read Twig: render vs include but it isn't what I'm looking for. I am not sure where and when should I use render, and when should I use include, as the behavior of these expressions seems very similar to me. What is the fundamental differences…
0x1gene
  • 3,349
  • 4
  • 29
  • 48
13
votes
8 answers

Symfony 2 - An error occurred while loading the web debug toolbar (404: Not Found)

Since the update to symfony 2.2, the web debug toolbar is no longer loaded in app_dev.php. I get the following error: An error occurred while loading the web debug toolbar (404: Not Found). Do you want to open the profiler? In the prod.log I get…
Bol
  • 131
  • 1
  • 1
  • 4
13
votes
2 answers

Refresh the database connection if connection drops or times out

I have a Symfony command line task that has a habit of dropping the mysql connection. Its a data import task. Which fetches data from multiple connections. Its not one big query but a few smaller ones. It seems to drop the connection the first time…
Robbo_UK
  • 11,351
  • 25
  • 81
  • 117
13
votes
1 answer

ORM Doctrine ManyToOne on update CASCADE (Symfony)

I have two entities class Promotor { /** * @ORM\ManyToOne(targetEntity="Ciudad", inversedBy="promotor") * @ORM\JoinColumn(name="ciudad_id", referencedColumnName="id", nullable=false) */ protected $ciudad; and class Ciudad { /** * @var…
JGrinon
  • 1,453
  • 1
  • 14
  • 36
13
votes
1 answer

How can I use 'foreign key' on doctrine?

I am making the lesson administration system on symfony2 and doctrine I am confused to use foreign key in doctrine. /Entity/User.php class User extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") *…
whitebear
  • 11,200
  • 24
  • 114
  • 237
13
votes
6 answers

Laravel 4 Exception: NotFoundHttpException

My Laravel 4 application's logs sometimes show a NotFoundHttpException: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
13
votes
2 answers

Symfony2 get validation constraints on an entity

Im working on a method to get all validation constraints of an entity (what i am trying to achieve is to return this data in JSON and apply the same constraints on client side using JQuery Validation Plugin), however im having some trouble getting…
Youssef
  • 1,033
  • 8
  • 16
13
votes
1 answer

Create entity on entity flush

How can I achieve this: For example, I have an entity called Issue. I need to log changes of a field of this entity. If a user changes the field "status" on the Issue entity I need to create a database record about it with the user, who changed the…
ideea
  • 353
  • 1
  • 3
  • 10
13
votes
4 answers

Cache folder grown very very fast

I'm use Symfony2 into one critical application. For each client (each tab in browser is client) JS through AJAX request data each second. And folder /cache/dev/profiler/ grown really fast! 17Gb for 2 days! How can i disable this writing?
Neka
  • 1,574
  • 4
  • 22
  • 36
13
votes
3 answers

How to filter my Doctrine queries with Symfony ACL

Symfony ACL allows me to grant access to an entity, and then check it: if (false === $securityContext->isGranted('EDIT', $comment)) { throw new AccessDeniedException(); } However, if I have thousands of entities in the database and the user has…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
13
votes
4 answers

how to check the user role inside form builder in Symfony2?

Okay, i'm trying to check if an user has a specific role, i did this however, when i do this: public function buildForm(FormBuilder $builder, array $options) { $builder ->add('nombre',null,array('label' => 'Usuario')) …
Splendonia
  • 1,329
  • 3
  • 37
  • 59
13
votes
3 answers

Symfony 2 application with Wordpress as CMS

I would like to build a sf2 application and maintain all the content ( categories, articles, pages, media, etc ) in WordPress with internationalization ( wpml plugin ). The app would have it's own admin and for managing the content the user would…
Liviu
  • 1,023
  • 2
  • 12
  • 33
13
votes
1 answer

How to use roles in SonataAdminBundle

I started to use SonataAdminBundle in a Symfony2.1 application. I developed all the Admin classes and now I wish to add roles to prevent view, list and edit actions to such user groups (e.g. non-admin users). Notice that I don't use the…
JeanValjean
  • 17,172
  • 23
  • 113
  • 157
13
votes
4 answers

Search Box in Symfony2 with Solr

I want to create Search box in front page of my website but I don't know how to create one using Solr. All my website is developed in Symfony2. I don't use Database for searching. How I can do this?. In my project Solr bundle use this: use…
Kunwar Siddharth Singh
  • 1,676
  • 6
  • 33
  • 66