yii2-detail-view如何添加file

usekartik\detail\DetailView;

usekartik\file\FileInput;

echo DetailView::widget([

'model'=>$model,

'condensed'=>false,

'hover'=>true,

'mode'=> Yii::$app->request->get('edit') =='t'? DetailView::MODE_EDIT: DetailView::MODE_VIEW,

'panel'=> [

'heading'=>$this->title,

'type'=> DetailView::TYPE_INFO,

],

'attributes'=> [

//            'id',

'title',

'describe',

'media_url:url',

'rtmp_url:url',

'flv_url:url',

'hls_url:url',

[

'attribute'=>'chatroom_groupid',

'label'=>'聊天室编号',

'value'=>$model->chatroom_groupid

],

'streamid',

'presenter',

[

'attribute'=>'price',

'label'=>'价格',

'value'=>$model->price

],

[

'attribute'=>'cover_url',

'label'=>'封面地址:',

'format'=>'raw',

'value'=> Html::img($model->cover_url),

'type'=>DetailView::INPUT_FILEINPUT   //注意看这里,这样就可了

],

],

'deleteOptions'=> [

'url'=> ['delete','id'=>$model->id],

],

'enableEditMode'=>true,

])

你可能感兴趣的:(yii2-detail-view如何添加file)