Menus

Monday, 11 February 2019

Yii2 Create span tag in DetailView widget



The span tag is like the div tag. It has no meaning at all and is mostly used for styling by using an id or class


Code Here

[
'attribute' => 'is_status',
        'format' => 'raw',
'value' => (($model->is_status == '1') ? '<span class="label label-success">Active</span>' :      '<span class="label label-danger">Deactive</span>' ),
],


Create url in DetailView widget

           

 [
             'attribute' => 'notice_file_path',
'format' => 'raw',
'value' =>  (!empty($model->notice_file_path) ? Html::a($model->notice_file_path, ['notice-file', 'nid' => $model->notice_id], $htmlOptions=["target"=>"_blank", 'data' => ['method' => 'post',]]) : " - ")
    ],




No comments:

Post a Comment