さて、私はほとんどのMVCがどのように機能するかを持っています
いくつかのサイト/クラス名/クラス関数/関数
class test(){
public function test2(){
// action will be 'function' in adress
$action = $this->action ? $this->action : array($this, 'test3');
function test3(){
print 1;
}
$action();
}
}
したがって、実行somesite/test/test2/test3
すると '1' が出力されますが、実行somesite/test/test2/phpinfo
すると phpinfo が表示されます。
質問: クラス関数内の関数の存在を確認する方法は?
UPD
phpinfo を忘れないでください。function_exists で表示されます。method_existsはクラス関数で検索しますが、クラス関数
UPDの関数では検索しません
class test{
public function test2(){
// site/test/test2/test3
$tmpAction = $this->parenter->actions[1]; // test3
$test3 = function(){
print 1;
};
if(isset($$tmpAction)){
$$tmpAction();
}else{
$this->someDafaultFunc();
}
}
}