src/Factory.php
public static function onload($instance_identifier, $callback, $ignore_instancename = false) {
		$args = func_get_args();
		
		// get instance name in params string
		$params		= explode(':', $instance_identifier);
		$classname	= $params[0];
		
		// we always have to create a fully namespaced class path
		if ($classname{0} !== '\\') {
			$classname = '\\Morrow\\' . $classname;
		}

		// use the instancename or the last part of the classname for saving the args
		$instancename = (isset($params[1])) ? $params[1] : '_morrow_default';

		// save callback
		if ($ignore_instancename) {
			self::$_onload_callbacks[$classname][] = $callback;
		} else {
			self::$_onload_callbacks[$classname . ':' . $instancename][] = $callback;
		}
	}
public static function onload($instance_identifier, $callback, $ignore_instancename = false) {
		$args = func_get_args();
		
		// get instance name in params string
		$params		= explode(':', $instance_identifier);
		$classname	= $params[0];
		
		// we always have to create a fully namespaced class path
		if ($classname{0} !== '\\') {
			$classname = '\\Morrow\\' . $classname;
		}

		// use the instancename or the last part of the classname for saving the args
		$instancename = (isset($params[1])) ? $params[1] : '_morrow_default';

		// save callback
		if ($ignore_instancename) {
			self::$_onload_callbacks[$classname][] = $callback;
		} else {
			self::$_onload_callbacks[$classname . ':' . $instancename][] = $callback;
		}
	}
public static function onload ( $ instance_identifier , $ callback , $ ignore_instancename = false ) { $ args = func_get_args ( ) ; // get instance name in params string $ params = explode ( ':' , $ instance_identifier ) ; $ classname = $ params [ 0 ] ; // we always have to create a fully namespaced class path if ( $ classname { 0 } !== '\\' ) { $ classname = '\\Morrow\\' . $ classname ; } // use the instancename or the last part of the classname for saving the args $ instancename = ( isset ( $ params [ 1 ] ) ) ? $ params [ 1 ] : '_morrow_default' ; // save callback if ( $ ignore_instancename ) { self :: $ _onload_callbacks [ $ classname ] [ ] = $ callback ; } else { self :: $ _onload_callbacks [ $ classname . ':' . $ instancename ] [ ] = $ callback ; } }
Registers a callback that is executed when an instance is created.

@param	string		$instance_identifier The instance identifier.
@param	callable	$callback A PHP callback.
@param	boolean		$ignore_instancename Set to true if you want all instances of the class to execute the callback.
@return	null
Registers a callback that is executed when an instance is created .