[eluser]esra[/eluser]
[quote author="wiredesignz" date="1196533180"]Something similar to the Observer Pattern, where each controller has a method of registering itself somewhere with a list of its methods, libraries, helpers etc.
or
Each controller could have a inbuilt method to describe itself.
include($controller)
subclass $controller (somehow defeat the parent::__construct call)
$controller->describe()[/quote]
This is possible, but it's probably easier to implement in Kohana because both the front controller and controller are extended from an abstract controller class making it easier to support a loosely coupled collection of MVC modules. Then the observer pattern can be implemented from a parent class which could be extended. In any case, it's probably going to result in a system/ hack or a sophisticated hook solution.
There is also the Mediator pattern which can be implemented with or without an Observer. In the former case, action notifications are passed from Collegue objects to the Mediator as class arguments and in the latter case as events using the Observer pattern. The Mediator can then communicate with other subcontrollers in the same module to perform synchronizations between subcontrollers (e.g., updating a input text box after making a selection from a list). But this results in a fundamental architectural model shift from MVC to PAC (Presentation-Abstraction-Control). It is possible to implement the Mediator pattern at the controller level in CI where each controller is a mediator and subcontrollers are collegues, but cross-controller communication would mandate the use of the Observer pattern. The alternate solution is to hack Codeigniter.php as a concrete Mediator or to to use a hook solution.
Both of the above solutions are easier to implement in PHP5.