/** * @return \yii\db\ActiveQuery */ public function getCurrency() { return $this->hasOne(Currency::className(), ['id' => 'currency_id']); }
?> <div class="account-form"> <?php $form = ActiveForm::begin(); ?> <?php if ($model->scenario == 'insert') { ?> <?php echo $form->field($model, 'type')->dropDownList(['money' => 'Money', 'credit' => 'Credit', 'creditcard' => 'Creditcard', 'invest' => 'Invest', 'card' => 'Card', 'bonus' => 'Bonus', 'debt' => 'Debts'], ['prompt' => '']); ?> <?php echo $form->field($model, 'currency_id')->dropDownList(ArrayHelper::merge(['' => ''], Currency::listAll())); ?> <?php } else { ?> <?php echo $form->field($model, 'type')->textInput(['disabled' => 'true']); ?> <?php echo $form->field($model, 'currency_id')->textInput(['disabled' => 'true']); ?> <?php } ?> <?php