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' => [
[
'attribute' => 'playlistid',
'type' => DetailView::INPUT_HIDDEN,
],
'title',
'content',
[
'label' => '是否默认',
'attribute' => 'isdefault',
'value' => Carouselplaylist::isDefault($model->isdefault),
'type' => DetailView::INPUT_SWITCH,
'widgetOptions' => [
'pluginOptions' => [
'onText' => '是',
'offText' => '否',
]
],
],
[
'attribute' => 'starttime',
'label' => '开始时间',
'value' => $model->starttime,
'type' => DetailView::INPUT_DATETIME,
'widgetOptions' => [
'pluginOptions' => [
'autoclose' => true,
'todayHighlight' => true,
]
],
],
[
'attribute' => 'endtime',
'value' => $model->endtime,
'type' => DetailView::INPUT_DATETIME,
'widgetOptions' => [
'pluginOptions' => [
'autoclose' => true,
'todayHighlight' => true,
]
],
],
// [
// 'attribute' => 'program',
// 'items' => $model->program,
// 'type' => DetailView::INPUT_CHECKBOX_LIST,
// 'format'=>'raw',
// ],
[
'format' => ['raw'],
'attribute' => 'program_list',
'type' => DetailView::INPUT_CHECKBOX_LIST,
'items' => $model->program,
'widgetOptions' => [
'pluginOptions' => [
'autoclose' => true,
'todayHighlight' => true,
]
],
],
],
'deleteOptions' => [
'url' => ['delete', 'id' => $model->playlistid],
],
'enableEditMode' => true,
]);
//echo $form->field($model, 'program')->checkboxList('Carouselplaylist[program]',$model->program);
echo "节目列表";
echo Html::ul($model->programlist, [
'itemOptions' => ['style' => 'list-style-type:decimal;']
]);