Can I get the controller action from given URL?
In my project, I will have different layout used for admin and normal users. i.e.
something.com/content/list - will show layout 1.
something.com/admin/content/list - will show layout 2.
(But these need to be generated by the same controller)
I have added filter to detect the pattern'admin/*'
for this purpose. Now I need to call the action required by the rest of the URL ('content/list
' or anything that will appear there). Meaning, there could be anything afteradmin/
it could befoo/1/edit
(in which case foo controller should be called) or it could bebar/1/edit
(in which case bar controller should be called). That is why the controller name should be generated dynamically from the url that the filter captures,
So, I want to get the controller action from the URL (content/list) and then call that controller action from inside the filter.
Can this be done?