定制 phphleb/api-multitool 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phphleb/api-multitool

最新稳定版本:v2.0.0

Composer 安装命令:

composer require phphleb/api-multitool

包简介

A set of traits for creating an API

关键字:

README 文档

README

PHP PHP License: MIT

Can be used either separately or in conjunction with the HLEB2 framework: github.com/phphleb/hleb

The set represents independent traits, each of which implements highly specialized methods that are used in controllers.

Installation

Using Composer

 composer require "phphleb/api-multitool:^2.0"

or download the library to the 'vendor/phphleb/api-multitool' folder.

BaseApiTrait

All auxiliary traits are collected in the trait BaseApiTrait as a set. Therefore, it is enough to connect it to the controller and get a complete implementation. If another set of these traits is needed, then you need to either use them as a group or combine them into your own set. It is best to include such a trait in the parent class of controllers that implement the API, so as not to have to do this for everyone.

For the HLEB2 framework it might look like this (implementation example):

<?php
// File /app/Controllers/Api/BaseApiActions.php

namespace App\Controllers\Api;

use Hleb\Base\Controller;
use Phphleb\ApiMultitool\BaseApiTrait;

class BaseApiActions extends Controller
{
    // Adding a set of traits for the API.
    use BaseApiTrait;

    function __construct(array $config = [])
    {
        parent::__construct($config);

        // Passing the debug mode value to the API constructor.
        $this->setApiBoxDebug($this->container->settings()->isDebug());
    }
}

After this, all controllers inheriting from this class will have methods from each trait in the set.

More details can be found in the framework documentation.

Testing

API traits tested using github.com/phphleb/api-tests

统计信息

  • 总下载量: 28
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固