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

symfony4 How create DataFixtures with entities relations

Under Symfony4.2, I have a Translate entity (id, gb_name, fr_name) and LocationCountry entity (id, ISO3166-2 name: GB,FR, DE…, translate_id) I define a CSV file with 255 countries ("GB", "Great Britain", "Angleterre"…) and I want to push it in…
bcag2
  • 1,988
  • 1
  • 17
  • 31
1
vote
2 answers

Bundle specific exception listener

Lets say I have 3 different bundles. I am adding to event listeners to each bundle. When there is any exception in Bundle1, then Bundle2 and Bundle3 should not listen it. I have tested it adding to each bundle eventlistener but when there is any…
MRustamzade
  • 1,425
  • 14
  • 27
1
vote
1 answer

Symfony4 - Validate fields based on values of other fields

I am building a very large form with multisteps and some conditional fields and cannot find a good solution for my problem. For example if field A is "Foo" then field B is shown via Javascript and must be validated via Symfony, otherwise the field…
1
vote
2 answers

Why am I getting undefined index "company" in Symfony entity relationship

I'm a little confused here, I have listed a couple of classes cut down to just the parts needed: class Instruction{ /** * @ORM\Column(nullable=true) * @ORM\ManyToOne(targetEntity="App\Entity\Company", inversedBy="instructions") …
Glen Elkins
  • 867
  • 9
  • 30
1
vote
2 answers

How to make Symfony / Panther use the test-environment in tests?

When performing functional tests with the Panther-Client, the webserver that is started in the background does not use the "test" environment. Instead it seems to use the parameters provided in the .env file (currently points to the "dev"…
Sqrt-1764
  • 321
  • 1
  • 17
1
vote
1 answer

Problem implementing FosUser with Symfony4

I want to use FosUserBundle with symfony 4. To do that, i use this : https://vfac.fr/blog/how-install-fosuserbundle-with-symfony-4 But when i finished I have this error message : The service "fos_user.util.password_updater" has a dependency on a…
Khristophe
  • 31
  • 5
1
vote
1 answer

Symfony 4. Workflow initial_place doesn't work

In workflow.yml I define initial_place. framework: workflows: case_workflow: type: 'workflow' # or 'state_machine' audit_trail: enabled: true marking_store: type:…
olek07
  • 513
  • 2
  • 7
  • 21
1
vote
1 answer

FOS Rest Bundle - Controller must return Response object, but it returns View

I'm trying to setup FOS Rest Bundle on symfony 4.2.3. and I'm following this tutorial: https://www.thinktocode.com/2018/03/26/symfony-4-rest-api-part-1-fosrestbundle/ Installed and configured the bundle: //annotations.yaml rest_controller: …
MilanG
  • 6,994
  • 2
  • 35
  • 64
1
vote
1 answer

Symfony4 MongoDB inject repository

I try to injcect doctrine mongo repository to controller. In services.yaml file I added entry: App\Account\Repository\MongoAccountRepository: factory: ["@doctrine_mongodb", getRepository] arguments: -…
Papub
  • 75
  • 1
  • 9
1
vote
2 answers

How to submit array to an unmapped form field in symfony 4

I'm trying to submit array with values to a symfony 4 form field but the validation keeps failing. I'm in the process of updating my application from symfony 2.7 to symfony 4. The problem is that a form that I used to use now always fails validation…
Dylan
  • 11
  • 1
  • 2
1
vote
3 answers

Symfony 4. How to access the service from controller without dependency injection?

I have several services: DieselCaseService, CarloanCaseService LvCaseService. The controller decides which of services to get. $type = $quickCheck["type"]; /** * @var $caseService \App\Service\Cases\CaseInterface */ $type = 'diesel; // for test…
olek07
  • 513
  • 2
  • 7
  • 21
1
vote
0 answers

How to secure app and be able to use Symfony Auth credentials in Symfony + VueJs SPA

I've implemented an api-platform app with Symfony4 + GraphQl + axios + vuejs; all this is working as a SPA which uses a single controller action to render a template and from there all the router is handled by vue-router. So far so good. When I'm…
Juan I. Morales Pestana
  • 1,057
  • 1
  • 10
  • 34
1
vote
0 answers

Login Via Linkedin in Symfony 4.2

I am working on a form where I need to get LinkedIn profile data in the fields. the form is on multiple URLs as I have a careers page where multiple jobs available on each job page there is a form and my URL becomes like:…
Owais Aslam
  • 1,577
  • 1
  • 17
  • 39
1
vote
1 answer

Token storage contains no authentication token and denyAccessUnlessGranted()

I'm having an error: "The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL. Which is caused by denyAccessUnlessGranted() added to a controller. It happens on test…
Roman Newaza
  • 11,405
  • 11
  • 58
  • 89
1
vote
1 answer

How to inject a service in another service and get User in Symfony 4?

I'm new in Symfony, I try to use Dependency injection to get User in a service (i think) services.yaml : App\Service\Test\RESTAuthenticatedService: calls: - method: getTrigramme arguments: …
1 2 3
99
100