PHP端如何做好API版本的控制?
PHP端如何做好API版本的控制?简单的说就是 1.0 和 2.0 ... 怎么更好的处理
回复内容:
PHP端如何做好API版本的控制?简单的说就是 1.0 和 2.0 ... 怎么更好的处理
目前用的TP框架,使用了二级控制器做版本管理,不知道你们都是怎么做处理的
请参考apigility
<code>$router = [ 'v1' => 'api_v1_controller', 'v2' => 'api_v2_controller', ... ]; </code>
class api_v2_controller extends api_v1_controller
调用的时候
/v1/login
/v2/getUserInfo
使用类的继承机制解决这个问题吧。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
