Пример #1
0
/* @var $this yii\web\View */
/* @var $model app\models\Tblorders */
/* @var $form yii\widgets\ActiveForm */
?>

<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 
 /**
  * Finds the Tblclients model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Tblclients the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Tblclients::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getClient()
 {
     return $this->hasOne(Tblclients::className(), ['client_id' => 'client_id']);
 }