PHP code example of w3lifer / yii2-js-data-provider

1. Go to this page and download the library: Download w3lifer/yii2-js-data-provider 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/ */

    

w3lifer / yii2-js-data-provider example snippets

 php


namespace app\controllers;

class JsDataProviderController extends \yii\web\Controller
{
    public function actionIndex(): string
    {
        return $this->render('index');
    }
}
 php


/**
 * @see \app\controllers\JsDataProviderController::actionIndex()
 *
 * @var \yii\web\View $this
 *
 * @see http://localhost:809/js-data-provider
 */

$this->title = 'JsDataProvider';

\w3lifer\Yii2\JsDataProvider::widget([
    'const' => 'MY_CONST',
    'data' => [
        'foo' => 'bar',
        'baz' => 'qux',
    ],
]);