Beispiel #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getKullanci()
 {
     return $this->hasOne(User::className(), ['id' => 'kullanci_id']);
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'user_id']);
 }
Beispiel #3
0
<div class="kitaponeri-form">

    <?php 
$form = ActiveForm::begin();
?>

    

    <?php 
echo $form->field($model, 'kitap_id')->dropDownList(ArrayHelper::map(Kitaplar::find()->all(), 'kitap_id', 'kitap_adi'), ['prompt' => 'Kitap Seçiniz..']);
?>


    <?php 
echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(User::find()->all(), 'id', 'username'), ['prompt' => 'Kullanıcı Seçiniz..']);
?>


    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Öner' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>