I have multiple Controller objects that either execute some script and then redirect to a specific page, or gather some data, send it to a View object and then display that View.
Instead of having a page for each controller instantiation (for example main_menu.php
, image_browser.php
, manage_users.php
), I have an index.php
page that contains a class which instantiates specified classes. The class to be instantiated is specified via URL GET variables when index.php
is called. The class that manages instantiation checks if the specified class is in an array of allowable class names and, if it is, it instantiates the class (controller) and if it is not, it instantiates the MainMenu class.
Is this class that I have, which manages legal class names, a design pattern?
Or, is this not a design pattern?