Tag: symfony resources

  • 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 […]

  • My symfony command line cheat sheet

    I can never remember all the symfony commands. So I will add them here one at a time as I need them to create a cheat sheet. Cache – clearing the cache explained Clear all the caches php bin/console cache:pool:clear cache.global_clearer  

  • Symfony 5+ how to import or link to javascript and css files with webpack encore

    Symfony has a handy way of importing your css and javascript files into your templates/pages to use them. You can find the full info in the docs link here. This was a little confusing to me at first.  Mostly due to my lack of knowledge of some of the Webpack and  modern JS features like […]

  • How to get the user id in a service in Symfony 5

    How to get the user id in a service in Symfony 5

    There are a few ways I have found to get a user id. None of the classes you can inject such as UserInterface, SessionInterface, TokenInterface, Security etc.   contain an actual getUserId() method. There is absolutely no method named this other than in the user Entity, if your entity contains a column named id. You can  […]

  • How does login and authentication work in Symfony 5.*

    How does login and authentication work in Symfony 5.*

    This is basically just my notes at this time and what I have found. I’ll keep adding to it over time. I can never, ever for the life of me remember how this complicated BS works. To learn that see the links section. Here is an excellent article about the files involved, the process etc. […]

  • Symfony Session resources list

    Symfony Session resources list

    Plain session docs – This is the symfony documentation page about Sessions alone. This link shows the basic configuration and use of Sessions in Symfony. This also mentions not starting a session for Anonymous users and has links to other info about sessions. Configuring Sessions and Save handlers – Symfony documentation link. This covers more […]

  • Symfony errors and exception handling resources

    How to customize error pages – Documentation page about how to create custom error pages. How to Customize Access Denied Responses – specifically about how to customize access denied responses. This is useful for when you use voters to authorize a users access to content.

  • Links and resources about Symfony firewall and authentication system

    One thing you will want to do is view your current security settings to do so you use this command. php bin/console debug:config security Old symfony cookbook security entry – This is an ancient link to nearly the very beginning of symfony. This explains the mechanics of the Symfony security system if you are like […]