This question is related to my last one, but seemed sufficiently more concrete that it warranted a new thread with a new title.
I'm wondering how one could perform some custom controller logic in Omeka before sending a user to the route they requested. For instance, say I want to use local storage to store the last route a user requested within my domain. Each time a user requests a new route within my application, I want to destroy the old key/value pair I stored in their local storage, set a new key/value pair in the localstorage, then send the user to the route they requested (in that order).
How can I perform this kind of pre-route logic in Omeka? Is it possible to tap into some abstract application logic to carry out this work? I'm imagining that I might need to write a meta controller that imports the show methods from the collections controller, items controller, exhibit controller, etc., then in my meta controller I would define the logic to be performed before the show method is called. I would prefer not to go this way if possible, as there are a decent number of routes for which I want to perform work (e.g. the local storage task) before I show the user the view associated with that route.
If I need to go the way described above, do others know the best way to import the show method from the collections controller (say) in Omeka 2.3.1? Once I know this syntax, I think I can carry out this work. In any event, I'd be grateful for any insights others can offer on this query.