Home >php教程 >PHP源码 >api接口应用类框架

api接口应用类框架

PHP中文网
PHP中文网Original
2016-05-26 08:20:361068browse

             

 $v) {
    $v = trim($v);
    $v = strip_tags($v);
    $v = addslashes($v);
    $data[$k] = $v;
}

$data['action']=explode('_',$data['action']);

try{
    include DOCROOT . '/model/' . $data['action'][0] . '/' . $data['action'][0] . '.php';
    $api = new $data['action'][0]($data);
    $api->$data['action'][1]();
}
catch (Exception $e) {
    echo $e->getMessage();
}


class api {

    public $data = array();

    function __construct($data) {
	    //根据需要,在此加载公用资源;
        $this->data = $data;
    }

}

?>

                                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn