Beispiel #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCurrency()
 {
     return $this->hasOne(Currency::className(), ['id' => 'currency_id']);
 }
Beispiel #2
0
?>

<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