PHP code example of apexwire / yii2-restclient

1. Go to this page and download the library: Download apexwire/yii2-restclient 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/ */

    

apexwire / yii2-restclient example snippets


    'components' => [
        'restclient' => [
            'class' => 'apexwire\restclient\Connection',
            'config' => [
                'base_uri' => 'https://api.site.com/',
            ],
        ],
    ],

class MyModel extends \apexwire\restclient\ActiveRecord
{
    public function attributes()
    {
        return ['id', 'name', 'status'];
    }
}

$config['modules']['debug'] = [
    'class' => 'yii\debug\Module',
    'panels' => [
        'rest' => ['class' => 'apexwire\restclient\DebugPanel'],
    ],
];
sh
php composer.phar