XF 2.1 Same route with multiple "int" meanings

mjda

Well-known member
I want to create a route where "transactions/this-transaction.1" will use transaction_id and title, but then "transactions/mike.1/create" will use user_id and username.

Is this possible? If so, how?
 
I think you should be able to do this by defining a single parameter (transaction_or_user_id) and fetching the transaction in your index action and the user in your other actions. The issue becomes generating links, but if you create a link building callback for the route you can figure out which type of entity is passed in and pass in the parameter as expected.

It might be better to use a sub-name for users instead though.
 
Back
Top Bottom