Yii2 Annotations Generate API Document Extension

Overview

Yii2 Annotations Generate API Document Extension


Latest Stable Version Total Downloads Latest Unstable Version License Suggesters Dependents

yii2-api-doc

Generate online api document by code annotation for yii2 easily

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist zhuzixian520/yii2-api-doc "*"

or add

"zhuzixian520/yii2-api-doc": "*"

to the require section of your composer.json file and run

composer install

Usage

Once the extension is installed, simply use it in your code by :

return [
    'modules' => [
        'api_doc' => [
            'class' => 'zhuzixian520\api_doc\Module',
            'hostApiDev' => 'http://api-dev.demo.com',//开发环境接口主机地址
            'hostApiProd' => 'http://api.demo.com',//生产环境接口主机地址
            'hostApiTest' => 'http://api-test.demo.com',//测试环境接口主机地址
            'author' => 'Trevor',
            'email' => '[email protected]',
            'logo_src' => '/img/logo_64_64.png',//web目录下
            'icp_num' => '粤ICP备15025495号',
            'copyright_website' => 'http://www.sijiche.com',
            'company_start_year' => '2015',
        ],
        'v1' => [
            'class' => 'api\modules\v1\V1Module',
        ],
    ],
];

Controller code comments in the API

class PassportController extends yii\rest\Controller
{
    /**
     * 微信PC网页登录
     * @method POST
     * @token 0
     * @param string code 同意授权后的code 是
     * @res string token 访问令牌
     * @return array
     */
    public function actionLoginByWechatPc(): array {}
}

Output

img.png

img_1.png

Access the API document address

just like gii or debug,and you can also change the V parameter to switch API versions

http://yourhost/api_doc?v=1

Contact Us

Email:[email protected]

You might also like...
An extended bootstrap alert and alert block widget for Yii2 (sub repo split from yii2-widgets)
An extended bootstrap alert and alert block widget for Yii2 (sub repo split from yii2-widgets)

yii2-widget-alert This extension contains a couple of useful widgets. The Alert widget extends the \yii\bootstrap\Alert widget with more easy styling

Simple RBAC Manager for Yii2 (minify of yii2-admin)
Simple RBAC Manager for Yii2 (minify of yii2-admin)

Yii2 Mimin Simple RBAC Manager fo Yii 2.0. Minify of yii2-admin extension with awesome features Attention Before you install and use this extension, t

Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations

Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations

Okex API Like the official document interface, Support for arbitrary extension.

It is recommended that you read the official document first Okex docs https://www.okex.com/docs/en Okex Simulation Test API https://www.okex.com/docs/

Yii2-symfonymailer - Yii 2 Symfony mailer extension.

Yii Mailer Library - Symfony Mailer Extension This extension provides a Symfony Mailer mail solution for Yii framework 2.0. For license information ch

Yii2 extension for format inputs based on AutoNumeric.js

Yii2 extension for format inputs based on AutoNumeric.js

OAuth 2.0 Yii2 Extension
OAuth 2.0 Yii2 Extension

OAuth2.0 Extension for Yii2 framework The following clients are currently supported for authorization: vk.com [register your application] mail.ru [reg

Generates documentation for your REST API from annotations

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Laravel api document generator
Laravel api document generator

Jheckdoc laravel Simple laravel api document generator Demo page: https://jheckdoc-laravel-demo.herokuapp.com/api/documentation Installation You can i

Html-sanitizer - The HtmlSanitizer component provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a document's DOM.

HtmlSanitizer Component The HtmlSanitizer component provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a documen

This document provides the details related to Remittance API. This APIs is used to initiate payment request from Mobile client/others exchange house.

City Bank Remittance API This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Installation You c

Quickly and easily expose Doctrine entities as REST resource endpoints with the use of simple configuration with annotations, yaml, json or a PHP array.

Drest Dress up doctrine entities and expose them as REST resources This library allows you to quickly annotate your doctrine entities into restful res

Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.

DMS Filter Component This library provides a service that can be used to filter object values based on annotations Install Use composer to add DMS\Fil

Annotations Docblock Parser

Doctrine Annotations Docblock Annotations Parser library (extracted from Doctrine Common). Documentation See the doctrine-project website. Contributin

:tada: Release 2.0 is released! Very fast HTTP router for PHP 7.1+ (incl. PHP8 with attributes) based on PSR-7 and PSR-15 with support for annotations and OpenApi (Swagger)

HTTP router for PHP 7.1+ (incl. PHP 8 with attributes) based on PSR-7 and PSR-15 with support for annotations and OpenApi (Swagger) Installation compo

Industrial-strength annotations for PHP

php-annotations Source-code annotations for PHP. Copyright (C) 2011-2015 Rasmus Schultz [email protected] https://github.com/php-annotations/php-anno

This library can parse a TypeSchema specification either from a JSON file, or from PHP classes using reflection and annotations.

This library can parse a TypeSchema specification either from a JSON file, or from PHP classes using reflection and annotations. Based on this schema it can generate source code and transform raw JSON data into DTO objects. Through this you can work with fully typed objects in your API for incoming and outgoing data.

Simple and Lightweight PHP Class & Methods Annotations Reader

README Simple and Lightweight PHP Class & Methods Annotations Reader Forked from eriknyk/Annotations 项目地址 github https://github.com/phppkg/annotations

Invalidate caches and achieve high hitrate with readable and maintainable annotations

Purgatory Purgatory is an extension which makes it possible for Symfony applications to handle enormous load using minimal infrastructure. Infrastruct

Releases(1.0.0)
Owner
Trevor
Seasoned PHP software engineer with a background in full-stack Web development
Trevor
Generates documentation for your REST API from annotations

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Nelmio 2.1k Jan 6, 2023
Industrial-strength annotations for PHP

php-annotations Source-code annotations for PHP. Copyright (C) 2011-2015 Rasmus Schultz [email protected] https://github.com/php-annotations/php-anno

php-annotations 138 Dec 29, 2022
phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to generate a complete set of API Documentation

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Jan 3, 2023
Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API

Luracast Restler ![Gitter](https://badges.gitter.im/Join Chat.svg) Version 3.0 Release Candidate 5 Restler is a simple and effective multi-format Web

Luracast 1.4k Jan 2, 2023
Generate Sphinx/ReStructured documentation from PHPDoc

PHP-phpdoc-to-rst Forked from Francesco "Abbadon1334" Danti by AeonDigital. In this fork the changes has only visual and superficial effects [ just be

Rianna Cantarelli 0 Nov 16, 2021
An API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

null 2k Dec 17, 2022
A php API documentation generator, fork of Sami

Doctum, a PHP API documentation generator. Fork of Sami Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documenta

Code LTS 203 Dec 21, 2022
A PHP framework foucs on API fast development.接口,从简单开始!PhalApi简称π框架,一个轻量级PHP开源接口框架,专注于接口服务开发。

PhalApi开源接口框架 / PhalApi API Framework 读音:派框架 Stargazers over time 开发文档 / Documents 专为PHPer准备的优雅而详细的开发文档,请看:PhalApi 2.x 开发文档。 PhalApi 2.x English Docs.

dogstar 1.5k Dec 30, 2022
Sami: an API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

null 2k Dec 17, 2022
Document templates Laravel package is intended for creating/managing user editable document template

Document Templates Introduction Document templates Laravel package is intended for creating/managing user editable document templates, with ability to

42coders 139 Dec 15, 2022