PHP code example of buttflattery / yii2-formwizard

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

    

buttflattery / yii2-formwizard example snippets


    $addressModel = new Address();

    "steps"=>[
      [
        'title'=>'Step Title',
        'type' => FormWizard::STEP_TYPE_TABULAR,
        'model'=> $addressModel
      ]
    ]
    

    //either using model directly
      $addressModel = Address::find()
          ->where(
            ['=','user_id',Yii::$app->user->id]
          )->all();

      //or using the model relation if you have `getAddress()` defined inside
      //the `User` model. `$user` has the selected user in code below
      $addressModel = $user->address;

    "steps"=>[
      [
          'title'=>'Step Title',
          'type' => FormWizard::STEP_TYPE_TABULAR,
          'model'=> $addressModel
      ]
    ]

    

    'fieldConfig'=>[
        'except'=>[
            'created_on','updated_on'
        ]
    ]
  

  'fieldConfig'=>[
      'username'=>[
          'options'=>[
              'class'=>'my-class'
          ]
      ]
  ]
  

 
  'fieldConfig'=>[
      'user.name'=>[
          'options'=>[
              'class'=>'my-class'
          ]
      ],
      'book.name'=>[
          'options'=>[
              'class'=>'my-class'
          ]
      ],
   ]
   

      'field_name'=>['options'=>['class'=>'my-class']]`
      
bash
php composer.phar