I’m making a a app in Symfony. I get Entities Answer and Question which are related. I want to enable users to add the answer to the question but I’ve got the problem with getting question_id to AnswerEntity. Here it what I came up with: Answer Controller AnswerForm: and AnswerEntity The error is: [enter image description here][1] [1]: https://i.stack.imgur.com/fYGpo.png but
Tag: symfony
Symfony reusable AJAX select / ChoiceType
I want to create a reusable AJAX-based select (select2) using Symfony form types and I’ve spent quite some time on it but can’t get it to work like I want. As far as I know you cannot override options of form fields after they have been added, so you have to re-add them with the new config. The Symfony docs
How to create dropdown select in Symfony easy admin crud panel?
I am new in Symfony. I have relation tables such as authors, books and book_authors. One book can have many authors and one author can have many books. So, here is my tables: And now, I am trying to implement crud controller with easy admin extension. And But in BookAuthorsCrudController I have a problems: I can’t use book_id and author_id
Error framework-extra-bundle Anotation “Unable to parse file […] The XML file is not valid.”
There is a recurring error in my Symfony projects since a few months. Every time a file at the root of the project is edited (even a space add in an a.txt file will reproduce the bug), I get this error. Unable to parse file “[RootPath]vendorsensioframework-extra-bundlesrcDependencyInjection/../Resources/configannotations.xml”: The XML file “[RootPath]vendorsensioframework-extra-bundlesrcDependencyInjection/../Resources/configannotations.xml” is not valid. The error is remove with the command
Symfony 5 queryBuilder count data
in one of my queries I am joining three tables to allow me to filter by taking into account these three tables. The problem is when I do a counter of the data from the main table (CV table), like I join the language table (ManyToMany), the categories table and the diploma table (manyToMany), when I do a counter of
How to force creating a new Symfony application for a specific PHP version?
I want to generate a Symfony application which can be compatible with PHP version up to 7.4.22. On my local machine, PHP version is 8.0.2 but on the hosting is 7.4.22. Symfony application is generated from local machine using standard composer command I look over create-project arguments to see if I could add some constrains but none seems to be
Symfony 5 – ManyToOne __isInitialized__: false
I try to get value from object but objects return __isInitialized__: false and null values what did I miss? twig situ dump : situ entity : event entity : category entity : Answer You just got to know the doctrine lazy loading feature. It fetches the data until you fired the getter method the first time. You could know this
Symfony api/doc route shows 404 on live server, but is OK on localhost
I have deployed my Symfony 5 app on live server (production). I left my .env file with DEV variables. Firstly my my homepage index.php was showing 404 URL not found on the server, so I had to execute ln -s public_src public and since that my homepage was showing fine. However I required and implemented a NelmioApiDocBundle via composer and
Why kernel.controller and AppFiltersListener take too long time
I’m trying to improve the project’s performance, and discover all request takes 567ms. Why do those two sections take too long time ??!! I use symfony2.5 and php5.6 Any ideas, please? Answer I’ve solved First of all i installed APC (PHP caching) on my webserver and restart it. Modify my doctrine configuration to use APC. Modify the service configuration as
using simple XML (php to change one attribute)
I have an xml input in the form of a string and I want to look at it and find a particular element and modify it. The part of the xml input I’m interested in looks like this and is part of the hierarchy of the in the string the ED element varies so im only interested in identifying all