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

How to debug symfony4 authentication failure

I am trying to set up a traditional login and registration form following the symfony 4 documentation. Using the registration form I seem to be able to register users correctly into the mariaDB database on arch linux. I am using the symfony…
NanoPish
  • 1,379
  • 1
  • 19
  • 35
8
votes
1 answer

How to configure Doctrine to use yaml mapping on Symfony 4

I'm new to Symfony 4 I use Doctrine an I want to use yaml entity mapping. So i configured the file doctrine.yaml and change type:annotation to type:yml. And when I tried php bin/console make:entity, there is no yaml mapping file generated linked to…
Ny Aina
  • 83
  • 1
  • 1
  • 6
8
votes
1 answer

How can I override resources for Third-Party bundles in Symfony 4?

I did a fresh Symfony installation by using Symfony Flex and the new skeleton belong to the next Symfony 4 directory structure. Next, I'm going to override some resources like templates, translations, etc. from an external bundle. I've tried to…
user8020553
8
votes
1 answer

symfony: How to set configuration parameters files for different environments?

How to setup a different configuration parameters file for each environment? At the moment parameters in parameters.yml are used in both dev and prod environment, but I need different parameters in order to deploy my app in prod.
user3174311
  • 1,714
  • 5
  • 28
  • 66
7
votes
1 answer

FOS UserBundle UserManager::__construct() must be an instance of ObjectManager

Fresh installation of symfony 4.4, then symfony flex and some common recipes, then I was trying to setup fos userbundle, I have this issue I cannot get around. Argument 3 passed to FOS\UserBundle\Doctrine\UserManager::__construct() must be an…
Alex Seif
  • 308
  • 3
  • 13
7
votes
1 answer

Multiple file validation: "This value should be of type string"

I'm trying to use Symfony Validator on a file upload form (form extension's validation) and I'm getting this error message: messageTemplate: "This value should be of type string." from Symfony\Component\Validator\ConstraintViolation Upload works…
Gigs
  • 199
  • 1
  • 12
7
votes
3 answers

Symfony 4 - route : "The requested URL was not found on this server"

this is my first post so i'll try to be understandable. I am starting with symfony, and there is a problem i can't resolve alone. This is my controller, and I am working with WAMP. When my Url is "mysite.local", it work normally, and it show me what…
Kendrick Larlar
  • 73
  • 1
  • 1
  • 4
7
votes
2 answers

Expected argument of type "string", "null" given at property path

Actually when I try to edit the form by sending empty fields, the above error comes on , My UserType class looks like: class UserType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { …
Mustapha GHLISSI
  • 1,485
  • 1
  • 15
  • 16
7
votes
2 answers

Sylius liip imagine: Unable to open image

I'm working on a Sylius 1.5 project, everything is working fine on my local environment however when deploying to my dev environment I'm getting an error on filtered images (using liip imagine filters). The environment consists of a docker…
J Dubuis
  • 492
  • 5
  • 13
7
votes
4 answers

Symfony 4: how to safely 'join' migrations together? / remove migrations in between the first and last?

I was recently tweaking around with my DB and noticed that I made 5 migrations on top of my existing 2. So 7 in total, m1, m2, ..., m7. From these 5, I only want the latest version. So I was thinking I could remove m3, m4, m5, m6, m7 and migrate…
user8678484
7
votes
1 answer

Symfony 4 session expire too soon

My php session with Symfony 4.0 expire too soon even if I set it up for several days in config/packages/framework.yaml. framework: {...} session: handler_id: ~ cookie_lifetime: 604800 {...} When the user complete the signin process, he…
7
votes
3 answers

How to hide a route from API Platform documentation

I'm building an API with API Platform under Symfony4, I want to hide an entity in the doc which is accessible only to the ROLE_ADMIN of the blow no interest to be visible in the doc. Here is the entity I want to hide:
Chris99391
  • 551
  • 1
  • 6
  • 18
7
votes
2 answers

Symfony 4 / Webpack Encore : jQuery doesn't work

jQuery doesn't work and I can't use my bootstrap dropdown, custom javascript... After a npm run dev (or npm run build), app.js file is well created and loads in the browser. Compilation is done without any error. I tried to enable…
user9801655
7
votes
1 answer

A tree builder without a root node in Symfony 4.2

I upgraded my Symfony project from 4.1 to 4.2 and get this notice 12 times in profiler: A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0. and the trace of the log is: {▼ …
A.Seddighi
  • 1,695
  • 1
  • 20
  • 43
7
votes
1 answer

How to validate array of arrays in Symfony 4

I want to know how can I validate array of arrays in symfony. My validation rules are: User - NotBlank Date - Date and NotBlank Present - NotBlank So far I have done this: $validator = Validation::createValidator(); $constraint = new…
Martin
  • 1,259
  • 3
  • 17
  • 36