CodeIgniter Forums
Reuse of existing controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Reuse of existing controller (/thread-37332.html)



Reuse of existing controller - El Forum - 01-06-2011

[eluser]Siddhesh[/eluser]
Hi,

I have created a user area for registered users where I have one controller with name "conversations". I want to create a new user area for guest users and I don't want to complicate existing user area. So my intend is to create a new area for guest users with bit different url, say index.php/guest/<controllers>. Now there is same functionality for conversations for guest users too.

Is it possible to reuse the code for conversation controller?

(Note : I have extended base controller class as My_profileBase for registered users and thinking to use different base controller for guest user pages).

Please give me your valuable suggestions.


Reuse of existing controller - El Forum - 01-06-2011

[eluser]Cristian Gilè[/eluser]
Hi Siddhesh,

take a look at this: DRY


Reuse of existing controller - El Forum - 01-06-2011

[eluser]Siddhesh[/eluser]
Thanks Cristian Gilè,

Will have a look.