-4
public function processApi(){
$func = strtolower(trim(str_replace("/","",$_SERVER['REQUEST_URI']))); //echo $func;
if((int)method_exists($this,$func) > 0)
$this->$func();
else
$this->response('',404);
echo '404'; // If the method not exist with in this class, response would be "Page not found".
}
感謝をしてみてください。 、それでもエラーです。 エラー:予期しない '' – jerry
MVC構造体を使用するとエラーが発生しますが、コアoopsを使用すると何も得られませんMVCを使用する場合はエラーが発生します$ this-> router-> fetch_method(); $ _SERVER ['REQUEST_URI']を置き換えます –
私はコアコードを使用しました。 – jerry