PHP code example of hiddenpathz / yii2-quick-edit-accordion

1. Go to this page and download the library: Download hiddenpathz/yii2-quick-edit-accordion 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/ */

    

hiddenpathz / yii2-quick-edit-accordion example snippets


echo QuickEditAccordion::widget([
    'type' => 'list',
    'action' => Url::to(['controller/action']),
    'items' => [
        // Your items array
    ],
]);

public function actionSave() {
    Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
    $index = Yii::$app->request->post('index');
    $attribute = Yii::$app->request->post('attribute');
    $newValue = Yii::$app->request->post('newValue');

    // Logic for processing changes saving

    return ['success' => true, 'newValue' => $newValue];
}