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
66
votes
10 answers

Simple check if form field has errors in Twig template

In Twig template I check if a field has an error like this: {% if form.points.get('errors') is not empty %} Is there any method like: {% if form.points.hasErrors() %} to do it simpler? It's not a big difference, but if I can't do it easier why…
Dawid Ohia
  • 16,129
  • 24
  • 81
  • 95
66
votes
12 answers

Generating a single Entity from existing database using symfony2 and doctrine

Is it possible to generate a single entity from database using the Symfony2 console tool? In the middle of coding I had to add a table and there are modifications made to the existing entity classes. So I don't want all my entities regenerated. Any…
Sethunath K M
  • 4,702
  • 3
  • 28
  • 42
65
votes
9 answers

How to get the server path to the web directory in Symfony2 from inside the controller?

The question is as follows: How can I get the server path to the web directory in Symfony2 from inside the controller (or from anywhere else for that reason) What I've already found (also, by searching here): This is advised in the cookbook article…
Sylvix
  • 773
  • 1
  • 6
  • 7
65
votes
9 answers

The method name must start with either findBy or findOneBy. Undefined method Symfony?

I am working through part4 of Symfony2, and while updating the controller and helper class code i got the following error message Undefined method 'getLatestBlogs'. The method name must start with either findBy or findOneBy! before i had put some…
ScoRpion
  • 11,364
  • 24
  • 66
  • 89
64
votes
8 answers

Error "1038 Out of sort memory, consider increasing sort buffer size

In symfony2, doctrine2, I have a query which triggers an error : Error "1038 Out of sort memory, consider increasing server sort buffer size The query : $queryBuilder = $this ->createQueryBuilder('object') …
Sébastien
  • 5,263
  • 11
  • 55
  • 116
64
votes
5 answers

Doctrine Entities and business logic in a Symfony application

Any ideas / feedback are welcome :) I run into a problem in how to handle business logic around my Doctrine2 entities in a big Symfony2 application. (Sorry for the post length) After reading many blogs, cookbook and others ressources, I find that…
Koryonik
  • 2,728
  • 3
  • 22
  • 27
64
votes
5 answers

Use Javascript to access a variable passed through Twig

I have a controller that passes an array to a twig template, which I want to use in a script written on that page. How would I go about doing that? I've tried this in my .twig template: