Entry point of an MVC framework
| From: | Simon Dániel | Date: | Thu, 12 Jul 2012 20:21:21 +0000 |
| Subject: | Entry point of an MVC framework | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-318448@lists.php.net to get a copy of this message | ||
Hi,
I have started to develop a simple MVC framework.
I have a base controller class which is abstract and all of the
controllers are inherited from that. Every controller contains actions
represented by methods. (E. g. there is a controller for managing
product items in a webshop, and there are seperate actions for create,
modify, remove, etc.) There is also a default action (usually an index
page), which is used when nothing is requested.
But what is the best way to invoke an action? I can't do it with the
baseController constructor, becouse parent class can't see inherited
classes. And I can't do it with the constructor of the inherited
class, becouse this way I would overwrite the parent constructor. And
as far as I know, it is not a good practice to call a method outside
of the class, becouse the concept of operation of the class should be
hidden from the other parts of the application.