ZF 1.0


The controller architecture includes a plugin system that allows user code to be called when certain events occur in the controller process lifetime. 

In order to write a plugin class, simply include and extend the abstract class Zend_Controller_Plugin_Abstract.
None of the methods of Zend_Controller_Plugin_Abstract are abstract, and this means that plugin classes are not forced to implement any of the available event methods listed above. Plugin writers may implement only those methods required by their particular needs. 

Almost every application uses a database connection and acl module. Why doing this in the bootstrap and to mantain many lines of code there, instead of making it clear and mantainable. Of course you can have all these lines of code in your bootstrap, but you know for serious applications that recently will become an obstacle. That?s why Zend Framework allows you to use Front_Controller plugin.

	// plugins
	$frontController = Zend_Controller_Front::getInstance();
	$frontController->registerPlugin(new Application_Plugin_DBConnection());

require_once "Zend/Controller/Plugin/Abstract.php";

class Application_Plugin_DBConnection extends Zend_Controller_Plugin_Abstract {
	public function __construct() {

	public function initDB() {

		// db connection
		$db = Zend_Db::factory(_DB_ADAPTER, array(