src/Ubiquity/controllers/Startup.php
public static function runAction(array &$u, $initialize = true, $finalize = true) {
		$ctrl = $u [0];
		self::$controller = $ctrl;
		self::$action = "index";
		self::$actionParams = [ ];
		if (\sizeof ( $u ) > 1)
			self::$action = $u [1];
		if (\sizeof ( $u ) > 2)
			self::$actionParams = array_slice ( $u, 2 );

		$controller = new $ctrl ();
		if (! $controller instanceof Controller) {
			print "`{$u[0]}` isn't a controller instance.`<br/>";
			return;
		}
		// Dependency injection
		self::injectDependences ( $controller );
		if (! $controller->isValid ( self::$action )) {
			$controller->onInvalidControl ();
		} else {
			if ($initialize)
				$controller->initialize ();
			self::callController ( $controller, $u );
			if ($finalize)
				$controller->finalize ();
		}
	}
public static function runAction(array &$u, $initialize = true, $finalize = true) {
		$ctrl = $u [0];
		self::$controller = $ctrl;
		self::$action = "index";
		self::$actionParams = [ ];
		if (\sizeof ( $u ) > 1)
			self::$action = $u [1];
		if (\sizeof ( $u ) > 2)
			self::$actionParams = array_slice ( $u, 2 );

		$controller = new $ctrl ();
		if (! $controller instanceof Controller) {
			print "`{$u[0]}` isn't a controller instance.`<br/>";
			return;
		}
		// Dependency injection
		self::injectDependences ( $controller );
		if (! $controller->isValid ( self::$action )) {
			$controller->onInvalidControl ();
		} else {
			if ($initialize)
				$controller->initialize ();
			self::callController ( $controller, $u );
			if ($finalize)
				$controller->finalize ();
		}
	}
public static function runAction ( array & $ u , $ initialize = true , $ finalize = true ) { $ ctrl = $ u [ 0 ] ; self :: $ controller = $ ctrl ; self :: $ action = "index" ; self :: $ actionParams = [ ] ; if ( \ sizeof ( $ u ) > 1 ) self :: $ action = $ u [ 1 ] ; if ( \ sizeof ( $ u ) > 2 ) self :: $ actionParams = array_slice ( $ u , 2 ) ; $ controller = new $ ctrl ( ) ; if ( ! $ controller instanceof Controller ) { print "`{$u[0]}` isn't a controller instance.`<br/>" ; return ; } // Dependency injection self :: injectDependences ( $ controller ) ; if ( ! $ controller -> isValid ( self :: $ action ) ) { $ controller -> onInvalidControl ( ) ; } else { if ( $ initialize ) $ controller -> initialize ( ) ; self :: callController ( $ controller , $ u ) ; if ( $ finalize ) $ controller -> finalize ( ) ; } }
Runs an action on a controller

@param array $u An array containing controller, action and parameters
@param boolean $initialize If true, the **initialize** method of the controller is called
@param boolean $finalize If true, the **finalize** method of the controller is called
Runs an action on a controller