/* @var $this yii\web\View */ /* @var $model app\models\Comission */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="comission-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'objects_id')->dropDownList(ArrayHelper::map(Objects::getList(), 'id', 'name')); ?> <?php echo $form->field($model, 'agents_id')->dropDownList(ArrayHelper::map(Agents::getList(), 'id', 'name')); ?> <?php echo $form->field($model, 'value')->textInput(); ?> <?php echo $form->field($model, 'is_episode')->checkBox(['checked' => 1]); ?> <?php echo $form->field($model, 'start_epizode')->textInput(); ?> <?php
public static function getList() { return Agents::find()->All(); }
/** * @return \yii\db\ActiveQuery */ public function getAgents() { return $this->hasOne(Agents::className(), ['id' => 'agents_id']); }
/** * Finds the Agents model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Agents the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Agents::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }