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

        <?php 
echo $form->field($modelBook, 'publisher_id')->dropDownList(BookForm::createArrayMap(Publisher::className(), 'id', 'name'));
?>

        <?php 
echo $form->field($modelBook, 'type_id')->dropDownList(BookForm::createArrayMapTranslate(Type::className(), 'id', 'type'));
?>

        <?php 
echo $form->field($modelBook, 'status_id')->dropDownList(BookForm::createArrayMapTranslate(Status::className(), 'id', 'status'));
?>

        <?php 
echo $form->field($modelBook, 'category_id')->dropDownList(BookForm::createArrayMapTranslate(Category::className(), 'id', 'category_name'));
?>

        <?php 
echo $form->field($modelBook, 'library_id')->dropDownList(BookForm::createArrayMap(Library::className(), 'id', 'name'));
?>

        <?php 
echo $form->field($modelBook, 'edition')->textInput();
?>

        <?php 
echo $form->field($modelBook, 'year')->widget(yii\widgets\MaskedInput::classname(), ['mask' => '9999']);
?>

        <div class="form-group">