Changing default view->render() path?
Hey,
i was wondering if there was a way to alter the automatic view rendering path. Instead of writing .phtml files for each controller, I want to write them for each role and controller. For example, guestindex.phtml would be rendered by the index Controller when the role of the user is a guest, and adminindex.phtml is rendered after an admin goes to the index Controller.
I have seen ways to change the path to scripts, but I don't think that will help in my situation. I'm thinking along the lines of intercepting the controller before it renders and changing the path to '/'.$controller'./.$role.$controller;, but I'm not sure how to do this (I would probably be able to do it in the front controller by writing a plugin, but I'm not if I can write those for other Controllers).
I hope I've explained myself well enough!
|