PHP code example of jinowom / yii2-api

1. Go to this page and download the library: Download jinowom/yii2-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jinowom / yii2-api example snippets


'modules'=>[
    'myapi'=>[
        'class'=>'jinowom\api\Module',
        'apiConfig'=>ass' => 'jinowom\demo\Identity',  //这是用与测试的Identity
    ],
]

class Test extends \jinowom\api\IApi{ 
    function params(){}
    function handle($params){}
    function returnJson(){}
}

function params(){
    return [
        'myfield'=>['type'=>'string','validate'=>'      'extensions'=>'jpg,gif,png',
                'minSize'=>10240,
                'maxFiles'=>1,
            ],
            '