# php-hint **Repository Path**: liuxiaojinla/php-hint ## Basic Information - **Project Name**: php-hint - **Description**: API标准化数据格式响应处理器 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-05-11 - **Last Updated**: 2025-09-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hint | API标准化数据格式响应处理器 #### 介绍 API标准化数据格式响应处理器 #### 安装教程 `composer require xin/hint` #### 使用说明 **配置文件** ```php [ 'hint' => 'api', ], 'hints' => [ 'api' => [], 'web' => [ 'dispatch_success_tmpl' => 'common@/dispatch_jump', 'dispatch_error_tmpl' => 'common@/dispatch_jump', ], ], ]; ``` **构建提示器实例** ```php error("操作失败"); // 业务成功响应 $hint->success("操作成功"); // 数据结果响应 $hint->result([ [ 'name'=>'小明' ] ]); // 强制使用API提示器 $hint->shouldUseApi(); // 强制使用Web提示器 $hint->shouldUseWeb(); ```