Advertisement
Guest User

_form

a guest
May 31st, 2016
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <div class="events-form">
  2.  
  3.     <?php $form = ActiveForm::begin(); ?>
  4.  
  5.     <?= $form->field($model, 'topic')->textInput() ?>
  6.  
  7.     <?= $form->field($model, 'date')->widget(\yii\jui\DatePicker::classname(), [
  8.         'language' => 'uk',
  9.         'dateFormat' => 'yyyy-MM-dd',
  10.     ])->textInput() ?>
  11.  
  12.     <div class="form-group">
  13.         <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  14.  
  15.         // Условие для добавление кнопки "Назад к информации" только для страницы Update
  16.         <?php
  17.         if (!$model->isNewRecord) {
  18.             echo Html::a('Back to info', ['view', 'id' => $model->id], [
  19.                 'id' => 'edit-link',
  20.                 'onClick' => "$('#view').find('.modal-body').load($(this).attr('href')); return false;",
  21.                 'class' => 'btn btn-success'
  22.             ]);
  23.         }
  24.         ?>
  25.     </div>
  26.  
  27.     <?php ActiveForm::end(); ?>
  28.  
  29. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement