Tag: symfony

  • How to add a fulltext index in Doctrine with Symfony 5+

    I had to google to find this answer on Stackexchange because I can’t find anything in the docs. Apparently this is something new so you don’t have to jump through the old circus hoops of the past. Apparently you can add a flags section like this to one of the index definitions of your Entity…

  • Symfony 5+ how to view dump output with AJAX requests

    Symfony 5+ how to view dump output with AJAX requests

    So the idea is to be able to use the Symfony VarDumper component to be able to dump values when sending an AJAX request and view them for debugging while in development mode, but not in production mode. Create a new directory To do this you will need to create an event subscriber and listen…

  • How to set application values for easy reuse in Symfony 5+

    How to set application values for easy reuse in Symfony 5+

    This article is a work in progress and will be further updated much more in the future. I don’t feel it is complete yet, I’d like to cover more details, more screenshots etc.. So how do you set/configure a value like an upload directory in one location in Symfony so that you can easily use…

  • Symfony Messenger vs EventDispatcher learn more

    Symfony Messenger vs EventDispatcher learn more

    So maybe you are looking into how to use Symfony in a more Event Driven way. Or maybe you want to speed up your apps response time to users. Or maybe the article title sounds interesting so you are reading this. Under the hood Symfony has something called an EventDispatcher system. You can see this…

  • How does Symfony decide what content type to return in a response?

    How does Symfony decide what content type to return in a response?

    This isn’t a real article it is a link to an article that explains this process. This way I can find this information again later when I need it and also google can find this question for others in the future and they can find the Symfony cast with the info they need.  And…. this…

  • Why can only Symfony controller methods be auto-wired and not other services methods?

    Why can only Symfony controller methods be auto-wired and not other services methods?

    So when I first encountered this issue with Symfony I was baffled.  Why can you auto-wire Symfony Controller methods but with Services (aka your other classes under src) why do you have to auto-wire only the constructor. I couldn’t figure out why I couldn’t auto-wire to the methods instead. Well, while working on deciding how…

  • Symfony 5+ error logging handlers explained

    Symfony 5+ error logging handlers explained

    This will be a super long article, this subject is way more complex than it originally sounds. As always, I’ll be updating this soon with more info and possibly more examples as I figure it out better. First off, you are not limited to just one logger in Symfony. However, the most popular is Monolog…

  • How to view Symfony 5+ FosJsRoutingBundle routes

    How to view Symfony 5+ FosJsRoutingBundle routes

    I can never remember this command. However, now that I am creating more AJAX and exposing endpoints I need this command more often. This command is found in the docs too. But I can never remember where, so I will write about it here. The command to view how FosJsRoutingBundle views your routes. php bin/console…

  • How to view Symfony routes

    I often need to view my current routes and how the Symfony kernel views them. This usually happens when I am adding new routes, I end up getting conflicts and have to resolve them by viewing what exists etc. The command to view your routes is really simple. Open your console and navigate to your…

  • Symfony how to get query string values sent by AJAX calls

    Symfony how to get query string values sent by AJAX calls

    When using a Symfony API endpoint for getting values such as maybe something like an auto-complete feature you will need to be able to send some text(what the user enters) to the backend. Then have the backend return a response based on that. For example with an auto complete feature, you might want to send…