I'm currently seeking to get the current record in a widget used in the backend.
For example, while editing the blogpost ID°99, I want to access the blogpost#99 object in my custom widget, which I positioned aside or below in the backend pages... Example:
The basewidget examples provides a way to get a fixed record using the extension config.yml, but I want to dynamically retrieve it.
I can work with $app or app.request injections, but I wanted to know if they're "cleaner" ways to do it - without having to redo some unnecessary logic to retrieve the record from the DB here.
Note that I'm talking about widgets, because the only other extension examples I found are custom field types, which aren't what I'm looking for. I want this purely for viewing purpose, not model/controller.