I have two related views (item and booking) in my custom component. A view for the items, and another view for booking them. So, if you browse to an item view, you will see there a "booking button" for this item, that sends you to the booking view with the particular item's data pre-filled in a form.
What a did to implement this was to add in the Booking controller a book
task, that basically reads the id for the item, and populate a session variable (from id
in item's view to id_item_to_book
in booking's view) to fill the booking form with the appropriate information. After that, it redirects you to the edit
booking page.
I tried to find something similar in the core components, but I didn't find. Is this the right way to do it? or there is a more Joomla 4 way?