Skip to content
Advertisement

Tag: symfony

How to add json with fixtures

On symfony I am trying to add some fixtures to the database some of which requires json format. I tried : I tried different other variations but in vain what is the correct way to do it? Answer You need to use the function json_encode to convert it into json. Output: {“France”:29}

Shopware : get the document number by its ID

I need to get the documentNumber in the documentRepository by its ID. I am doing a “simple” DAL request to do this but for some reason dumping the output gives empty fields. Here is my subscriber containing the DAL request : Here is my services.xml : I also tried to directly dump the result of the getInvoice() function and this

Symfony Forms Error: Entity of type “…” passed to the choice field must be managed. Maybe you forget to persist it in the entity manager

Objective I am trying to make a basic form that signs a new player up for a sport. This is taken from the Symfony example at: https://symfony.com/doc/current/form/dynamic_form_modification.html#form-events-submitted-data The Code I have 3 entities: PlayerList https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/PlayerList.php Sport https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Sport.php Position https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Position.php I have a form: NewPlayerType https://github.com/ChimeraBlack1/Symphart/blob/main/src/Form/NewPlayerType.php I have a controller: NewPlayerController https://github.com/ChimeraBlack1/Symphart/blob/main/src/Controller/NewPlayerController.php The Error: Details: I seem to get this error

Symfony, Request cannot find the service [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 1 year ago. Improve this question When I try to run my code I get the following error message : Cannot autowire argument $request of “AppControllerAppController::formulaire()”: it references

Advertisement