Exemple #1
0
/* @var $form yii\widgets\ActiveForm */
?>

<div class="objects-form">

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


    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'developers_id')->dropDownList(ArrayHelper::map(Developers::getList(), 'id', 'name'));
?>

    <?php 
echo $form->field($model, 'descripition')->textarea(['rows' => 6]);
?>

    <?php 
echo $form->field($model, 'logotype')->textInput(['maxlength' => true]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
 /**
  * Finds the Developers model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Developers the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Developers::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemple #3
0
 public function getDeveloper()
 {
     return $this->hasOne(Developers::className(), ['id' => 'developers_id']);
 }
Exemple #4
0
 public static function getList()
 {
     return Developers::find()->All();
 }