No details? PhpclassIndexAction {publicfunctionindex () {echoindex. rn;} publicfunctiontest ($ year2012, $ mon2, $ day21) {echo $ year. --------. $ month. -----------. $ day. rn;} publicfunction_before_index () {echo _ FUNCTION __.
No details? Phpclass IndexAction {public function index () {echo 'index '. "\ r \ n";} public function test ($ year = 2012, $ month = 2, $ day = 21) {echo $ year. '--------'. $ month. '-----------'. $ day. "\ r \ n";} public function _ before_index () {echo _ FUNCTION __. "\
<无详细内容> <无>
IsPublic () {$ class = new ReflectionClass ('indexaction'); // execute the pre-method if ($ class-> hasMethod ('_ before_index ')) {$ beforeMethod = $ class-> getMethod ('_ before_index'); if ($ beforeMethod-> isPublic () {$ beforeMethod-> invoke (new IndexAction );}} $ method-> invoke (new IndexAction); // execute the POST method if ($ class-> hasMethod ('_ after_index ')) {$ beforeMethod = $ class-> getMethod ('_ after_index'); if ($ beforeMethod-> isPublic () {$ beforeMethod-> in Voke (new IndexAction) ;}}// method with parameters $ method = new ReflectionMethod ('indexaction', 'test '); $ params = $ method-> getParameters (); foreach ($ params as $ param) {$ paramName = $ param-> getName (); if (isset ($ _ REQUEST [$ paramName]) $ args [] =$ _ REQUEST [$ paramName]; elseif ($ param-> isdefavaluvalueavailable ()) $ args [] = $ param-> getDefaultValue ();} if (count ($ args) = $ method-> getNumberOfParameters () $ method-> invokeArgs (new In DexAction, $ args); elseecho 'parameters is not match! ';