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
0 answers

Cannot do functional test with sender address in service or environment

While it is possible to create an environment variable SENDER_ADDRESS and access that in a controller, the address is not available in a functional test. This is due to the \tests directory being at the same level as \src. In an environment service…
geoB
  • 4,578
  • 5
  • 37
  • 70
1
vote
1 answer

Symfony deployment: error code 255 with composer install --no-dev

Here are the steps, I am following: Cloning my repository from github git clone https://github.com/EresDev/EresNoteSymfony.git . Updating .env file with APP_ENV=prod Then performing install composer install --no-dev I get following error:…
Eres
  • 1,559
  • 1
  • 16
  • 25
1
vote
2 answers

Symfony 4 DateType removed disabled with jquery but data not submitted

I have a DateType field on a form that is set to disabled=true . When a specific checkbox is checked by the user some jquery picks it up and removes the disabled property from the html but the value still doesn't get submitted by the form. Just…
Glen Elkins
  • 867
  • 9
  • 30
1
vote
1 answer

How to prevent numbers from rounding down in Sonata-admin?

Good Morning Everybody. I'm learning development and I have a problem on my first symfony4 project. It's a wineshop. My aim is to permit the vinegrower to add products data on database through Sonata-admin interface, then render that data on the…
ThomasC
  • 33
  • 6
1
vote
1 answer

How can I call a function?

I have a function in a class in App/src/utils. I have issue using it from a controller. I have to construct some sheets with phpspreadsheet. The method length is 260 lines. I don't think it's a good practice to have it in a function of the…
D.Picard
  • 99
  • 2
  • 13
1
vote
1 answer

How to remove steps from checkout in Sylius

I'm using sylius/sylius 1.3.9 with symfony/framework-bundle 4.2.4. Regarding the doc to remove states from checkout you have to replace the whole configuration of the Sylius core bundle. I put my configuration into…
witrin
  • 3,701
  • 1
  • 24
  • 49
1
vote
1 answer

Symfony 4 - vendor bundle cannot find tagged autowired service

I made simple API bundle which is(will be) shared among the projects. Every object/entity has its own configuration that says which fields and how they're gonna be serialized(decomposed to scalar values). How they're gonna be serialized depends on…
Dutch77
  • 949
  • 1
  • 6
  • 10
1
vote
1 answer

Custom Exception Controller in Symfony 4

I am building a custom exception controller in Symfony 4 to overwrite the ExceptionController class included in the Twig bundle. I am doing this as per the Symfony documentation for customizing error pages. # config/packages/twig.yaml twig: …
yevg
  • 1,846
  • 9
  • 34
  • 70
1
vote
1 answer

Dependency Injection: How to overwrite Framework Bundle service?

When using the Framework Bundle of Symfony 4.2 with the Serializer Component there are several Normalizers configured automatically by the Framework in a specific order. I want to replace one of these Normalizers (ObjectNormalizer) with my personal…
LBA
  • 3,859
  • 2
  • 21
  • 60
1
vote
1 answer

Why does Doctrine Query throw "Too many parameters" QueryException

This is in controller $candidats = $repository->findList( $data["recherche_candidat"]["diplomes"], $data["recherche_candidat"]["categories"]); And this in the repository public function findList($diplomes,$categories,) { …
Khalil
  • 288
  • 3
  • 16
1
vote
0 answers

Symfony 4 - SQLSTATE[42000] alter table for unknown reasons

I'm here because, I need your help. I'm working on a Symfony project, I just finished to modify my DataBase with MySqlWorkBench (I've done this because I have to present the DataBase at the end of the school year). After that, I've executed "Forward…
1
vote
1 answer

Rendering view after changing Locale by Ajax in Symfony 4

I am trying to change page language by a dropdown. Dropdown is generated by this code {{ form_widget(registrationForm.locale, { 'attr': {'onChange': 'languageChange()'} }) }} in the twig. Ajax function function languageChange() { let…
saku
  • 193
  • 3
  • 14
1
vote
1 answer

How to use orWhere in Doctrine | Return user who have ROLE_ADMIN and ROLE_USER

I want to return user who have ROLE_ADMIN and ROLE_USER I have did this in repository : return $this->createQueryBuilder('u') ->where('u.roles IN (:val)') ->setParameter('val','["ROLE_ADMIN","ROLE_USER"]') ->getQuery() …
Khalil
  • 288
  • 3
  • 16
1
vote
0 answers

How to configure Gedmo Sluggable in Symfony 4 properly?

I have tried to configure Gedmo Sluggable properly in a Symfony 4 application and failed. The issue is: it is not working. Any sluggable columns aren't recognized as being sluggable and stay empty after…
itinance
  • 11,711
  • 7
  • 58
  • 98
1
vote
1 answer

How to set min value DateTimeType [Symfony]

I want to set the minimal date in input date $builder->add('dateRdv', DateTimeType::class,['data' => new \DateTime(), 'attr' => ['min' => new \DateTime()]]) Error is : An exception has been thrown during the rendering of a…
Khalil
  • 288
  • 3
  • 16