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/ */
//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
]
]