SubscribedEvents not called with APP_ENV=prod
I have a EventSubscriber and the onKernelRequest
method is not called when APP_ENV=prod
. If APP_ENV=dev
the onKernelRequest
method is called.
Multiple url definition with conditions within the same controller for symfony’s routing system
Is there a way that I can generate multiple URLs within the same controller that use the same structure?
Add labels next to inputs of ArrayField on edit page
I have a property named myArray
which returns array like this:
Symfony MySQL Configuration Issue: Connection Refused despite Correct Credentials
I ‘, learning Symfony but I have a problem with configuration mysql. I’m using this fork https://github.com/Norivo7/symfony-docker and it work’s correctly with phpmyadmin too. I have default data to mysl –
host: 127.0.0.1,
username: dev,
password: dev
I can logged in to this db via MySQK WorkBrench. Problem is that into .env I have configuration like this
How to Modify Symfony Entity Getter Method to Return Date-only Values in REST API Responses?
I’m currently developing a Symfony-based REST API application, where I encounter a specific requirement related to the formatting of date values returned from entity fields. Within my entity, I have a field named birthdate
, defined as @ORMColumn(type="date")
. When this field is included in API responses, it provides both the date and time components, which is not aligned with the project’s specifications. Instead, I need the API response to exclusively provide the date part without any time information.
How to return a versioned asset as response in a Symfony Controller?
I have a rare case where I need a route for a specific asset. I need to return an asset like I would in Twig, but directly in a Controller action. I use the AssetMapper component for versioned assets as well.
Symfony upgrade (4.4 -> 5.4) JsonManifestVersionStrategy issue
By upgrading Symfony from 4.4 to 5.4 I’ve taken an error
CORS dynamic with Nelmio
I would like to have a dynamic CORS with Nelmio to allow people using my API, and protect from unsafe user.
Ex: in my database I have a list of ORIGIN that’s allowed to use it with an X-API-KEY