[TYPO3-ect] lib/div: some common initialization before any action

Alexey Boriskin boug at mail.ru
Fri Mar 23 19:26:46 CET 2007


I am writing an extension based on lib/div framework. It's a pleasure :)
But I have a feature request.
I need to create some commonly used objects, for example, object that 
manage user rights which should be accessible in any action of my 
conroller. I cannot extend constuctor of controller because my 'rights' 
object want to use configurations sub-object of a controller, but it is 
not yet created.

So, my proposal is to define a method of tx_lib_controller, that should 
be called before any action.

@@ -191,9 +191,17 @@
  		$controller = tx_div::makeInstance($controllerName);
  		$controller->parameters = $parameters;
  		$controller->configurations = $configurations;
+		$controller->init();
  		return $controller->$action();
  	}

+	/**
+	 * Some common initialization before any action. Empty by default.
+	 * @return void
+	 */
+	function init(){
+		return;
+	}


More information about the TYPO3-team-extension-coordination mailing list