view.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. /* @var $this yii\web\View */
  5. /* @var $model common\modules\attachment\models\Attachment */
  6. /* @var $form yii\widgets\ActiveForm */
  7. ?>
  8. <?php echo $this->render("_info",["model"=>$model]);?>
  9. <?php
  10. $form = ActiveForm::begin([
  11. 'action' => [
  12. 'view',
  13. 'id' => $model->primaryKey
  14. ],
  15. 'options' => [
  16. 'id' => 'control-form'
  17. ]
  18. ]);
  19. ?>
  20. <?= $form->field($model, 'title')->textInput(['class' => 'form-control']); ?>
  21. <?= $form->field($model, 'description')->textarea(['class' => 'form-control']); ?>
  22. <?= Html::submitButton("更新附件", ['class' => 'btn bg-maroon margin btn-flat'])?>
  23. <?= Html::a("编辑附件", ['update','id' => $model->primaryKey],['class' => 'btn bg-navy margin btn-flat'])?>
  24. <?php ActiveForm::end(); ?>
  25. <?= Html::a("删除附件", ['delete','id' => $model->primaryKey], ['class' => 'btn btn-default margin btn-flat','data-item-id'=>$model->primaryKey,'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?')])?>