PHP code example of rubin / yii2-crud-actions

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

    

rubin / yii2-crud-actions example snippets


public function actions()
{
    return [
        'index' => [
            'class' => 'rubin\yii2\crud\actions\ModelIndexAction',
            'searchModel' => new CameraSearch(),
        ],
        'view' => [
            'class' => 'rubin\yii2\crud\actions\ModelViewAction',
        ],
        'create' => [
            'class' => 'rubin\yii2\crud\actions\ModelCreateAction',
            'model' =>  new Camera(),
        ],
        'update' => [
            'class' => 'rubin\yii2\crud\actions\ModelUpdateAction',
        ],
        'delete' => [
            'class' => 'rubin\yii2\crud\actions\ModelDeleteAction',
        ],
        'position' => [
            'class' => 'rubin\yii2\crud\actions\ModelPositionAction',
        ]
    ];
}