Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Browsing all 3925 articles
Browse latest View live

Symfony4 Annotation routing does not work

I just started learning Symfony. I am following this official tutorial exactly. Routing works fine when done with config/routes.yaml but on using annotations:namespace App\Controller;use...

View Article


Problem integrating Service Workers into Symfony project

I'm trying to integrate Service workers in my Symfony project in order to cache some files and make my page into a PWA and make it work offline.Sadly, I stumbled into a problem and I've been trying to...

View Article


_local management in symfony 4

I try to set the variable {_local} in my routes ...here is the controller /* * @Route("/{_locale}" , name="home" , requirements={"_locale": "en|fr"}) */ public function generalHome($_locale) {...

View Article

Symfony SerializedName equivalent for collection attributes while denormalizing

I am having a json request { applicant_info:{"email": "jhon.doe@gmail.com","given_name": "jhon","family_name": "doe" }, productId: 12}Having a dto class as below:class Dto{ /** * @var int *...

View Article

why copy-from-recipe doesn't add any file to my base project?

I run a local flex server in my local pc (windows) from : https://github.com/moay/server-for-symfony-flexand I made a recipe with config/routes/api-form-bundle.yamland my manifest : {"bundles":...

View Article


API Platform GraphqQL - Mutation - How to add / remove element to / from...

So, doing this with a 'OneToMany' should be relatively straightforward - just setting the id of the 'one' on the many side,However, with ManyToMany I can't figure out, if there's a way to do this by...

View Article

Symfony 4 form - How to get the children element of parent inside subform

I'm trying to have list of cities based on the region and also the birth date of a person.That is why in my code I tried to do this : $builder->get('region')->addEventListener(...

View Article

How to fix "manifest file does not exist." in Symfony4

I am working on a project in Symfony 4.2 with Webpack. I'm versioning my code with BitBucket and I'm using heroku for my deployment. The app work very well on dev environnement on my local machine. But...

View Article


pass a variable from view to controller SYMFONY

I know that *passing a variable from view to controller is something that can't be done but I am using symfony and on the purchase form page I need to pass the purchase total to controller to save it...

View Article


Symfony 4 Mock service in functional test

I am testing a service which essentially is mostly serializing an object and sending it via a service to an external system.If I create the typical unittest I would mock the response of the serializer...

View Article

Symfony 4 mock private services

I have appplication which responsible to fetch various api's to collect data. I'm using Codeception As my testing framework and I need to mock API client class in my functional tests like this: public...

View Article

Uploading a file via PHP + Symfony 4 throws an "File not found error"

I am trying to upload a file using Symfony 4 documentation (https://symfony.com/doc/4.0/controller/upload_file.html) - yes, I know that is an obsolete version, but at the moment I can't update it.I...

View Article

Problem emptying a collection, it is not saved

For an entity with multiple properties, I have a form that shows one of those properties which is a collection.I have this form with EasyAdmin, I can add and remove items from the collection, the...

View Article


How to solve a symfony 4.0 deprecation: web_profiler.position

I'm on my last deprecation from 3.4 -> SF4.0. The deprecation reads:The "web_profiler.position" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0.I could not find...

View Article

How to define services and access it in controller?

I have a service file containing following lines of code.namespace App\Service;/** * Class MyService * @package App\Service */class MyService{ /** * @var string */ private $newTest; /** * MyService...

View Article


Symfony 4 test with Doctrine subscribers/listeners

I want to functional test my Symfony 4 app on a specific part using Doctrine subscribers. So i mock up my service as i mentionned it in this post : How to mock service with symfony 4 in functional...

View Article

Endpoint Server GraphQL (overblog-GraphQLBundle) Not support Method POST

For 3 Days, my project which worked perfectly locally, once put on the production server.GraphQl requests are a failure with the error "[Error: Network error: JSON Parse error: Unrecognized token...

View Article


symfony 4 build API GraphQL : overblog/GraphQLBundle vs ApiPlatform

I wish to set up a GraphQL API on a symfony 4 application, according to you between its two two solutions (overblog/GraphQLBundle vs ApiPlatform) which should I choose to build my API and why do you...

View Article

How to execute a Symfony command in background from a controller

I have a command which take a long time to run (it generates a big file).I would like to use a controller to start it in background and don't wait for the end of its execution to render a view.Is it...

View Article

Symfony Serializer XML add custom attribute to root node

When generating an XML file with Serializer component (in Symfony4) I want to add a custom attribute to the root node but I can't figure out how to.The docs mention how to name the root node, but not...

View Article
Browsing all 3925 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>