prompt
<?= $form->field($model, 'status')->dropDownList($array, ['prompt' => 'значение по дефолту']) ?>
public function rules()
public function relations ()
array('attribute list', 'validator name', 'on'=>'scenario name', ...validation parameters...)
attribute list: specifies the attributes (separated by commas) to be validated;
array('test, configsArray' ,'safe'),
<?= $form->field($model, 'username', [
'inputOptions' => ['class' => 'custom-class']
]); ?>
// return all customers in an array indexed by customer IDs
// SELECT * FROM `customer`
$customers = Customer::find()
->indexBy('id')
->all();
/user/admin/index
use yii\grid\GridView;
$userProvider->pagination->pageParam = 'user-page';
$userProvider->sort->sortParam = 'user-sort';
$postProvider->pagination->pageParam = 'post-page';
$postProvider->sort->sortParam = 'post-sort';
echo '<h1>Users</h1>';
echo GridView::widget([
'dataProvider' => $userProvider,
]);
echo '<h1>Posts</h1>';
echo GridView::widget([
'dataProvider' => $postProvider,
]);