# Fox **Repository Path**: focrs/fox ## Basic Information - **Project Name**: Fox - **Description**: PHP开发框架 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-05-27 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #Fox 设计原型 ``` route |-order |-trace |-index.php |-index.php |-user |-index.php view |-order |-trace |-index.php |-update.php |-index.php |-update.php |-user |-index.php |-create.php |-update.php api ... ``` 设计期望: R(A)R: 路由层(+API层)+响应层 路由层: 根据当前请求找到对应的入口文件index.php: ``` class \Route\Order\Trace{ function Index() { $data = \Fox\Api()->GetTraceData(); // API调用层 \Fox\Response()->View($data); // 响应层输出视图文件 } function Update($orderId) { if(\Fox\Request()->IsPost()) { \Fox\Api()->SaveTraceData(); // API调用层 \Fox\Resonse()->View($data); } else { \Fox\Response()->View(); } } } ``` 路由文件存放结构应与项目实际架构一致 API层: 负责数据读取和存储,封装数据读取和存储细节,对外只提供参数接口,接口需要通用权限验证,除此之外,增加一些特殊接口需要管理级别权限才能调用的安全机制 响应层: 将API层传送过来的数据与视图模板进行混合渲染,最终呈现给客户 Fox命名规范: ``` $User = \Fox\Curd('User')->Read(1); // 对象变量,首字母大写 function FistCapitalize() {} // 方法函数,首字母大写 ```