= DetailView::widget([
'model' => $model,
'attributes' => [
'name',
[
'attribute' => 'input_type',
'value' => function($model){
return Constants::getAdTypeItems($model->input_type);
}
],
'tips',
[
'attribute' => 'ad',
'format' => 'raw',
'value' => function($model){
switch ($model->input_type){
case Constants::AD_IMG:
return "
";
case Constants::AD_VIDEO:
return "";
case Constants::AD_TEXT:
return $model->ad;
}
}
],
'link',
'desc',
[
'attribute' => 'autoload',
'value' => function($model){
return Constants::getYesNoItems($model->autoload);
}
],
'sort',
[
'attribute' => 'target',
'value' => function($model){
return Constants::getTargetOpenMethod($model->target);
}
],
'created_at:datetime',
'updated_at:datetime'
],
]);