PHP code example of execut / yii2-crud-fields

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

    

execut / yii2-crud-fields example snippets


namespace execut\books\models;
class Book extends \yii\db\ActiveRecord {
    use \execut\crudFields\BehaviorStub;
    public function behaviors() {
        return [
            \execut\crudFields\Behavior::KEY => [
                'class' => \execut\crudFields\Behavior::class,
                'fields' => [
                    'id' => [
                        'class' => \execut\crudFields\fields\Id::class,
                    ],
                    'name' => [
                        'class' => \execut\crudFields\fields\StringField::class,
                        'attribute' => 'name',
                        '

 $model = new Book();
 echo 'Validation rules for the search and edit scenario';
 var_dump($model->rules());
 echo 'Forming ActiveQuery based on filtering parameters and configuring ActiveDataProvider';
 var_dump($model->search());
 echo 'Formation of list columns settings';
 var_dump($model->getGridColumns());
 echo 'Formation of settings for the creation/editing form';
 var_dump($model->getFormFields());
 

php composer.phar