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
12
votes
1 answer

Symfony2 and anonymous access to some route

With this configuration: firewalls: login: pattern: ^/login$ anonymous: ~ security: false foo: pattern: ^/foo$ anonymous: ~ security: false secured_area: pattern: ^/ …
Tower
  • 98,741
  • 129
  • 357
  • 507
12
votes
1 answer

How to get instance of entity repository in the Form (Type) class in Symfony 2?

Let's say I have ordinary *Type class: class LocationType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilder $builder, array $options) { $builder ->add(...) ... …
zerkms
  • 249,484
  • 69
  • 436
  • 539
12
votes
2 answers

Symfony 2 on virtual hosts

I have a problem here with Symfony 2. I want to have virtual host on Windows Vista PC, so I can access my Symfony application like this myapp.local.com. What I have tried: I added these lines to hosts file 127.0.0.1 local.com 127.0.0.1…
ArVan
  • 4,225
  • 8
  • 36
  • 58
12
votes
1 answer

Error on "production" environment on Symfony2

I´m currently developing a web site using Symfony2. On 'dev' environment everything works just fine, but when I try to access to the system with the DEBUG parameter on FALSE (trough app.php which invokes the appKernel with debugger disabled) the…
ButterDog
  • 5,115
  • 6
  • 43
  • 61
12
votes
2 answers

Symfony2/Doctrine QueryBuilder using andwhere()

I am using following method in a repository class to look for certain tags in my database: public function getItemsByTag($tag, $limit = null) { $tag = '%'.$tag.'%'; $qb = $this->createQueryBuilder('c'); $qb->select('c') …
Mike
  • 2,686
  • 7
  • 44
  • 61
12
votes
2 answers

Run PHPUnit tests of Symfony 2 application under Netbeans 7.1

I've spent some time to figure out how to configure Netbeans 7.1 to work with Symfony 2 and PHPUnit, but I didn't succeed. When I try to run any test under console, there is no problem. But when running using shift+F6, it returns "PHP Fatal error: …
pbuchman
  • 161
  • 2
  • 5
12
votes
3 answers

Getting Service Container in Symfony 2 Console Command gives "getKernel() on a non-object"

In the configure() function, I tried to get the service container class SetQuotaCommand extends ContainerAwareCommand { protected function configure() { parent::configure(); die(get_class($this->getContainer())); PHP Fatal…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
12
votes
4 answers

Circular Reference when injecting Security Context into (Entity Listener) Class

There was 2 questions here saying injecting the whole service container should solve this. But question ... see below (note difference between try 2 & 3) ... Try 1 public function __construct(SecurityContext $securityContext) { …
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
12
votes
1 answer

Is there an include_partial equivalent in Twig (symfony 2.0)?

I really like to use partial templates in my symfony 1.4 projets and I was wondering if there is something like that with Twig in symfony 2.0. It's way more clear and reusable to have something like that
Julien G
  • 415
  • 1
  • 5
  • 20
12
votes
2 answers

Validate single form field only in Symfony2

I'm looking for a way to validate just a single field (object property) against the constraints specified in the annotations of a particular entity. The goal is to send an AJAX request after the "onBlur" event of a form field, asking the server to…
grzechoo
  • 1,093
  • 3
  • 11
  • 20
12
votes
1 answer

Symfony2 Doctrine query

I'm new in symfony2 , I don't know how to write a below query in symfony2 using createQuery() select * from Post inner join Category on Post.category_id=Category.id inner join Priority on Post.priority_id=Priority.id order by priority_number desc I…
Asish AP
  • 4,421
  • 2
  • 28
  • 50
12
votes
3 answers

Symfony2: 1 form to edit a translatable entity

I have a translatable entity using the translatable behaviour of doctrine2. I'm trying to build a form that looks like this: | French |English| Spanish | +--+--------| |---------+------------+ | | |…
FMaz008
  • 11,161
  • 19
  • 68
  • 100
12
votes
4 answers

Behat authenticate Symfony2 user

I'm using Behat in Symfony2 / Doctrine2. Now, I have this scenario that boils down to the fact that "if I'm logged in and I go to /login, I shoud go to / instead": @login Scenario: Go to the login page while being logged in Given I am logged in …
tvlooy
  • 1,036
  • 10
  • 16
12
votes
5 answers

symfony2 twig whitelist html tags

I pass a variable to my twig template in Symfony2, this variable may contain
html tags, I have tried to create an extension (function), but the variable still gets escaped. How can I output a twig variable that allows the
tag? Is there…
jonv1
  • 586
  • 1
  • 6
  • 15
12
votes
3 answers

Which ORM to use with Symfony2?

I'm starting a new project with Symfony2 and I'm not really sure which ORM to choose. I've heard some bad things about Doctrine2, especially when it comes to inheritance and DQL. It seems like Propel is back from the dead, but on the other hand,…
Timothée Martin
  • 775
  • 4
  • 13
1 2 3
99
100