XJPHP RESTful : 是一个超轻量的快速开发框架。Light and Fast。
Encode : UTF-8
特色
- 基于 MVC 体系;
- 超轻量级,小巧的框架;
- 出色的性能;
- 广泛兼容标准主机上的各种 PHP 版本和配置;
- 实现简单,快速扩展;
- 清晰的应用分层,可以帮助您构建大型的应用;
- 支持路由分层,灵活的 URL 路由;
- PHP PDO 数据库的支持;
访问项目
https://git.oschina.net/UtilityClass/XJPHP-RESTful
控制器代码
[code lang="php"]<?php
// 控制器
class Index{
private $data;
// 初始化
public function Init($IDs)
{
$this->data = array();
$this->data["id"] = $IDs[0];
$this->data["class"] = __CLASS__;
$this->data["page_content"] = "index.php";
}
public function Get($IDs){
$this->data["title"] = "Welcome to ".$_ENV['XJ_PHP'];
$this->data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
$queryData = $this->input->value('queryData');
$this->load->view("index.php", $this->data);
}
public function Post($IDs){
$data = array();
$data["title"] = "Welcome to XJPHP";
$data["id"] = $IDs[0];
$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
xj_load_view("index.php", $data);
}
public function Head($IDs){
$data = array();
$data["title"] = "Welcome to XJPHP";
$data["id"] = $IDs[0];
$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
xj_load_view("index.php", $data);
}
public function Put($IDs){
$data = array();
$data["title"] = "Welcome to XJPHP";
$data["id"] = $IDs[0];
$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
xj_load_view("index.php", $data);
}
public function Delete($IDs){
$data = array();
$data["title"] = "Welcome to XJPHP";
$data["id"] = $IDs[0];
$data["id2"] = (isset($IDs[1]))?$IDs[1]:'';
xj_load_view("index.php", $data);
}
}
[/code]
文章评论