/** * Finds the Tblcountries model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Tblcountries the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Tblcountries::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getCountry() { return $this->hasOne(Tblcountries::className(), ['country_id' => 'country_id']); }
?> <div class="tblorders-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'client_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Tblclients::find()->all(), 'client_id', 'Names'), 'options' => ['placeholder' => 'Select client'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'country_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Tblcountries::find()->all(), 'country_id', 'country_name'), 'options' => ['placeholder' => 'Select country'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'rubric')->textarea(['rows' => 3]); ?> <?php echo $form->field($model, 'Other_instructions')->textarea(['rows' => 2]); ?> <?php echo '<label class="control-label">Add Attachments</label>'; echo $form->field($model, 'files')->widget(FileInput::classname(), ['options' => ['multiple' => true]]); ?>