[TYPO3-50-general] Discussion: ActionController Method Dispatch

Sebastian Kurfürst sebastian at typo3.org
Thu Jul 9 09:23:28 CEST 2009


Hi Robert,
>
> No, because - due to the routing mechanism - $actionMethodName could  
> for example
> be "dosomethingstupidAction" while $existingMethodName is something  
> like
> "doSomethingStupidAction".
Exactly. However, class and function names in PHP are all case  
insensitive.

The following example illustrates this:

<?php
class test {
	function myTestAction() {
		echo "method is run";
	}
	function run() {
		$var = 'mytestaction';
		if (method_exists($this, $var)) {
			echo 'method exists<br>';
		}
		call_user_func(array($this, $var));
	}
}
$obj = new test();
$obj->run();
?>

(outputted is "method exists" and "method is run").

So, I think we can change this :-)

Greets,
Sebastian


More information about the TYPO3-project-5_0-general mailing list