Symfony add logic to logout route
In a Symfony 5.0 Application I want to add custom logic for cleanup reasons when the user loggs out.What I have currenty is what is described in the...
View ArticleDeployment Symfony 4 with React js application on Heroku
My application developed with Symfony 4 in the backend and React js in the frontend, then I want to deploy it on Heroku. I have already connected heroku with my github repository. Finally after I...
View ArticleMy custom Form Type Template is ignored when rendering form
I created a custom field type class BootstrapToggleType extends AbstractType which is child of CheckboxType I also prefixed it just in case as followspublic function getBlockPrefix(): string{ return...
View ArticleSymfony 4 : good practice controller render
I just begun to use Symfony, and I came from CodeIgniter. In this framwork you pass parameters to the view with an array called $data. So if you want to pass the same variables in each views of a...
View ArticleSymfony 4 - VichUploaderBundle - filename is not persisted in the database
I have an entity "Support"on witch i want to link a file(PDF, DOC,...). I've followed the documentations and some videos to help, but i alway have this error :SQLSTATE[23000]: Integrity constraint...
View ArticleSymfony 4 - 3rd-party bundle commands are no longer automatically discovered
According to the documentation, a command class must extend Command or ContainerAwareCommand to be automatically discovered and registered (provided its bundle is registered in the Kernel, of...
View ArticleData Transformer vs.Constraints
I stumbled upon a question regarding Symfony's DataTransformers and how to properly use them. While I know how to implement and add them to my form field, I was wondering how DataTransformers are...
View ArticleImpossible to use Twig Reference from Symfony in override default error template
I overide custom 404 page by creating structuretemplates/bundles/TwigBundle/Exception/error404.html.twigLike was told here.But Twig Reference from Symfony not working there. I tried path(), url() and...
View Articlebug in filter with Symfony 4
I'm creating a filter(for 'offre' entity) by departement ,experience, type(of contract) and a key word all the filters give the right result but experience I don't know why it doesn't respond however I...
View ArticleAttempted to load class "LikeNotificationSubscriber" from namespace...
i have a course for symfony when i want to use a listener on a likes button to send a notification to the user i have this error. on the video he dont have the error it work fine. he use symfony 4.0...
View ArticleKnpPaginatorBundle: How to remove "p" parameter from pagination URL?
I'm using KnpPaginatorBundle for pagination in the project on Symfony 4.The URL of the pages is formed as follows:https://siteurl.com/sitepage.html?p=sitepage.html&page=3Please tell me how to...
View ArticleAttempted to load class "SensioFrameworkExtraBundle" from namespace...
I am clone project in Symfony 4 fron git repositories on Windows 10, Xampp with php 7.4, then I run composer install and run migartion, but when I try run the web I obtain error Attempted to load class...
View ArticleSymfony 4.2 and Nelmio Api Doc Bundle - Several documentation with multiple...
I'm using Symfony 4 and Nelmio Api Doc Bundle to create a service that will be only accessible trough APIs (both public frontend and private back office will be created using a JS framework)I need 2...
View ArticleSymfony 4 self-referencing association for recommended article
I have entity article with column title and text. Now I want to add up 3 recommended another articles to each. In documentation I read about doctrine selfrefrencing associtin and I dont know If I use...
View ArticleIntegration of API Platform into existing Symfony 4 project
I've got an requirement to integrate API Platform into existing Symfony 4 project. I'm total beginner with API Platform and just learning the basic concepts - but all I found were tutorials to create...
View ArticleExpected response code "250" but got an empty response
I can send my emails in localhost!I get this errorExpected response code "250" but got an empty response.I don't understand how update .env# .env# .MAILER_DSN isn't a real address: it's a simple format...
View ArticleWhy SMTP mails are not working from server with same hostname as sender mail...
I have a Symfony 4 application that sends mail with SMTP via OVH (with Swiftmailer). Let say the address i use to send mails is no-reply@domain1.com.I have two OVH servers with the same configuration,...
View ArticleHow to post a nested relation without IRI api-platform
I have 2 entities: Question and Answer where Question has a OneToMany relation Answer. I try to send a JSON with nested document, but the reponse show only data Question without nested Answer.Follow...
View Articleuse an array variable in twig
I got a variable from a controller in the form of an array (variable ads), on twig, I used:{% for ad in ads%}<tr> <td> {{ad.xxx}} {% if app.user and app.user == ad.author%}{{ad.yyyy}}{%...
View ArticleHow to test current date condition in behat?
I have feature that is based on current date, and the question is if it is good solution to write if condition in scenario. Simple example: if tested date is equal to current then other field is equal...
View Article