zoukankan      html  css  js  c++  java
  • Dingo 的安装

    安装Dingo需要下面的环境:

    • Laravel 5.1 或 lumen 5.1 +
    • php 5.59+

    1. 修改composer.json 文件,添加下面的代码:

    "require": {
        "dingo/api": "1.0.*@dev"
    }

    2 .然后根目录下执行composer update

    3. Laravel的配置

    config/app.php中的providers数组中添加

    'providers' => [
        DingoApiProviderLaravelServiceProvider::class
    ]

    通常情况下,我们都会配置Dingo,我们可以生成自己我们可以修改的dingo配置文件,终端里执行下面的代码

    php artisan vendor:publish --provider="DingoApiProviderLaravelServiceProvider"

    4. 门面

    Dingo 中自带了两个门面,你可以根据自己的需要添加

    //This is a facade for the dispatcher, however, it also provides helper methods for other methods throughout the package.
    
    DingoApiFacadeAPI
    
    //This is a facade for the API router and can be used to fetch the current route, request, check the current route name, etc.
    
    DingoApiFacadeRoute

    为了方便,可以为上面的门面设置别名

    'aliases' => [
         'APIRoute'  => DingoApiFacadeRoute::class,
         'API'       => DingoApiFacadeAPI::class,
    ]
  • 相关阅读:
    面向对象--封装
    面向对象--多态
    面向对象编程
    类的特殊成员
    新式类 VS 经典类
    python类的继承
    python析构函数
    类的公有属性
    (转)JAVA AJAX教程第二章-JAVASCRIPT基础知识
    (转)JAVA AJAX教程第一章-初始AJAX
  • 原文地址:https://www.cnblogs.com/wxy0126/p/10738311.html
Copyright © 2011-2022 走看看