PHP code example of oleg-chulakov-studio / yii2-rest

1. Go to this page and download the library: Download oleg-chulakov-studio/yii2-rest 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/ */

    

oleg-chulakov-studio / yii2-rest example snippets


public function accessRules()
{
    return [
        'index'   => $this->createAccess('get', true),
        'view'    => $this->createAccess('get', true, '@'),
        'create'  => $this->createAccess('post', true, '@'),
        'update'  => $this->createAccess('put, patch', true, '@'),
        'delete'  => $this->createAccess('delete', true, '@'),
        'options' => $this->createAccess(),
    ];
}