I\'m trying to use PHP reflection to dynamically load the class files of models automatically based upon the type of parameter that is in the controller method. Here\'s an e
This is a better regular expression than the one from that answer. It will work even when the parameter is optional.
preg_match('~>\s+([a-z]+)\s+~', (string)$ReflectionParameter, $result); $type = $result[1];