Kohana/CodeIgniter Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Kohana/CodeIgniter Question

Post by volomike »

Both Kohana and CodeIgniter, and a few other PHP MVC frameworks, require that we subclass a controller class before we get started. I guess they assume I might want to use more than the index() function of a controller class. My question to you is why do they do this? I mean, can't we have an MVC framework that just lets me create a new folder path and file in my controllers folder, and just start typing code without having to do the class declaration every time, especially if I'm only going to have one controller method in there, anyway (index())?

And if that's not possible, then has anyone figured out a shortcut I can stick in my class so that I don't need to subclass the controller class every time?
Post Reply