Questions tagged [symfony4]

Symfony is a PHP framework developed by SensioLabs. Symfony 4 was released in November 2017.

Symfony is a PHP web framework first released in July 2011 and was created by SensioLabs. Symfony 4 was released in November 2017. The latest LTS is 4.4.8 released in November 2019 and has support until 2022.

Differences from Symfony 3

  • Symfony Flex automates many of the tasks that previously had to be done manually - it’s based on Symfony Recipes, which are a set of automated instructions.
  • Version 4 also recommends a bundle-less setup, e.g. putting many of the source files directly in /src instead of something like /src/AppBundle.
  • Installing using the Symfony skeleton will create a relative small version of the app. Additional packages need to be added. A more fully-featured version (more similar to the »Symfony Standard Edition« in Symfony 3) is available with the Symfony Demo Application.
  • Minimum PHP 7.1.3

Documentation / Resources

  • Overview: Documentation for current version.
  • Flex: New way to manage Symfony apps.
  • Best Practices: Best practices for developing web apps, esp. the ones using the full-stack Symfony framework.
  • Symfony Recipes Server: Includes official and community recipes.
4007 questions
1
vote
1 answer

Dynamic database connection in Symfony 4

I am setting up a multi tenant Symfony 4 application where each tenant has it's own database. I've set up two database connections in the doctrine.yaml config. One of the connections is static based on an env variable. The other one should have a…
1
vote
2 answers

How to hide Api-plaform Docs from Nelmio Docs

I hope someone could help me to use Api-platorm with Nelmio. I use Api-plaform and Nelmio. I need to hide the Api-platform docs from Nelmio. I need to have 3 routes: /internal -> API-Platform Docs /external -> NELMIO-Docs /admin -> NELMIO-Docs My…
1
vote
1 answer

How customize data of EntityType with repository

I want to get customize choices from a FormType This is is the FormType: builder->add('demandes', EntityType::class, [ 'placeholder' => 'Choisissez une option', 'class' => DemandeCandidats::class, 'mapped' =>…
Khalil
  • 288
  • 3
  • 16
1
vote
2 answers

symfony 4 count method with doctrine-orm

I am a beginner in symfony 4, and I wanted to count the recording of an object, but it does not work. this is my code // Function count() in my repository class public function count() { return $this->createQueryBuilder('d') …
m.deye
  • 41
  • 2
  • 6
1
vote
3 answers

Symfony 4 + ReactJS Not Working Without Any Error

I am trying to add google map search capability for my project and i found a very nice react code for this (https://github.com/ubilabs/react-geosuggest) but i couldn't add this to symfony 4 based admin panel. To understand what is wrong i created a…
bahadir arslan
  • 4,535
  • 7
  • 44
  • 82
1
vote
0 answers

Symfony 4 validation Entity/DTO existence

For example, I have a password reminder form. How add annotation for email existence in database validation, for example @Assert\Exists. class PasswordRemindRequest { /** * @Assert\NotBlank * @Assert\Email */ private $email; …
pietrach
  • 47
  • 1
  • 8
1
vote
1 answer

Symfony4 project deployment

I'm working on my first symfony 4 project and i would like to upload it on my online server. My goal is to have it online on my domain to test it before a preview with my client. I tried to put my files on the www folder (by ftp) and add a .htaccess…
Noxray
  • 50
  • 5
1
vote
1 answer

Binding entities to query parameters only allowed for entities that have an identifier

I have a entity Annonce has Tags ManyToMany to Entity Tag When i search an Annonce by tags like this picture My probleme is : For example If the Bike tags exist in Database that will return Annonces with that tag, without errors If i add for…
Khalil
  • 288
  • 3
  • 16
1
vote
1 answer

How to upload multiple Files with Symfony 4

I need to develop a entity Annonce has a many images this is my attempts but not working :/ Annonce Entity:
Khalil
  • 288
  • 3
  • 16
1
vote
1 answer

reusable dynamic sidebar in Symfony 4 (Twig)?

I recently started using Symfony 4 and I am creating my first website with this wonderful framework right now. I have a sidebar that should be displayed in about half of my routes and the content of the sidebar should be filled with some data from a…
1
vote
1 answer

Composer installs symfony 3.4 instead of 4.x even with PHP 7.2

I'm on Ubuntu 16.04.6 LTS + Plesk 17.8.11 with several PHP versions installed (7.0, 7.1 and 7.2) Even if I set the following line in the .bashrc file: alias php='/opt/plesk/php/7.2/bin/php' I check (with php -v) that the current PHP version…
Pulsar
  • 91
  • 1
  • 1
  • 4
1
vote
1 answer

Using the Symfony Process component with commands that have embedded quotes

I am using the Symfony 4 Process component to run various ssh commands. This all worked last fall and fails now. The examples here are all real code (except for the remote host and username). This is the baseline:
David Patterson
  • 1,780
  • 3
  • 17
  • 40
1
vote
0 answers

Symfony 4: Updating an existing entity through a deserialized entity ends up with a new related item or with an ORMInvalidArgumentException

That's my first question here on Stackoverflow.com and before I'll write to much. First the controller function: /** * @Rest\Patch("/identifiers/v2/{id}") * * @ParamConverter("identifier") * @ParamConverter("identifierPatch",…
1
vote
0 answers

Twig files are not rendered after update (dev envitoment require clearing cache)

I merged some changes I had on other branch and since then I can't render twig changes on the server. Even though I have APP_ENV=dev in .env and files are uploaded I have to clear cache every time to see update. My twig.yaml is like this: twig: …
Aerogirl
  • 369
  • 4
  • 17
1
vote
2 answers

Undefined method isGranted in Symfony 4

I am using a statement from a Symfony2 app in Symfony4: $securityContext = $this->container->get('security.token_storage'); if($securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED') ){ . . . } I get always error: Attempted to call an…
Stefano Maglione
  • 3,946
  • 11
  • 49
  • 96