colly_wyx
2018-06-13 e4d5467f055ece8cc9dfdc02dd836bcc187034a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
 * 默认接口服务类
 *
 * @author: dogstar <chanzonghuang@gmail.com> 2014-10-04
 */
 
class Api_Default extends PhalApi_Api {
 
    public function getRules() {
        return array(
            'index' => array(
                'username'     => array('name' => 'username', 'default' => 'PHPer', ),
            ),
        );
    }
    
    /**
     * 默认接口服务
     * @return string title 标题
     * @return string content 内容
     * @return string version 版本,格式:X.X.X
     * @return int time 当前时间戳
     */
    public function index() {
        return array(
            'title' => 'Hello World!',
            'content' => T('Hi {name}, welcome to use PhalApi!', array('name' => $this->username)),
            'version' => PHALAPI_VERSION,
            'time' => $_SERVER['REQUEST_TIME'],
        );
    }
}