相关代码
/**
* InitPHP开源框架 - DEM
* @author zhuli
*/
class helloController extends Controller {
//rest_post|post 方法名称 + | + HTTP方法名
public $initphp_list = array("get_info"); //Action白名单
/**
* 这个是rest get方法请求
*/
public function rest_get() {
$curl = $this->getLibrary("curl");
echo "<br/><h1>只能通过GET方法请求</h1>";
}
/**
* GET方法获取URL中请求参数
*/
public function get_info() {
$username = $this->controller->get_gp("username");
echo "<br/><h1>GET方法获取URL中请求参数:" +$username+ "</h1>";
$this->view->display("demo/hello_get_info"); //使用模板
}
}