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

api接口应用类框架

PHP中文网
Release: 2016-05-26 08:20:36
Original
1114 people have browsed it

             

 $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;
    }

}

?>
Copy after login

                                   

Related labels:
Statement of this Website
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
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template