PHP code example of likai / yii-restful

1. Go to this page and download the library: Download likai/yii-restful 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/ */

    

likai / yii-restful example snippets


return array(
    'urlManager'=>array(
        'class' => 'Likai\\YiiRestful\\UrlManager',
        'urlFormat' => 'path',
        'showScriptName' => false,
        'resources' => array(
            'topics',
        ),
    ),
);

'resources' => array(
    'topics',
    array('posts', 'only' => array('index', 'create')), // just bind PostsController::actionIndex, PostsController::actionCreate action
    array('users', 'except' => array('delete', 'update')), // except UsersController::actionDelete, UsersController::actionUpdate action
),