I wish to have a page called "index" with a corresponding url "domain/controller/index" and another page called "admin_index" with a corresponding url "domain/admin/controller/index". The trick is that i want both pages to use the same view to render and the same function for the logic while on of the page's parameters are a flag indicating to the view from which url the view is rendered.
I need it because currently in my "index" page I have table with data. The page also has a smart filter for that page which requires a respectful amount of logic in the controller side. My problem is that currently there is an "Edit" button in each line which I don't want to share to all the users.
Currently I'm using the admin prefix to handle this kind of pages by protecting them by limiting the access from the web-server (Apache in my case).
Any ideas of how to implement this without duplicating the controller function?