Example:
~~~
echo Html::mediaList([
[
'heading' => 'Media heading 1',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. '.
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64',
'items' => [
[
'heading' => 'Media heading 1.1',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. ' .
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64'
],
[
'heading' => 'Media heading 1.2',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. ' .
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64'
],
]
],
[
'heading' => 'Media heading 2',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. ' .
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64'
],
]);
~~~
public static mediaList ( array $items = [], array $options = [] ) : string | ||
$items | array | the configuration of media items. The following properties can be set as array keys: - `items`: _array_, the sub media items (similar in configuration to items) (optional) - `heading`: _string_, the media heading - `body`: _string_, the media content - `src`: mixed, URL for the media article source - `img`: mixed, URL for the media image source - `srcOptions`: _array_, HTML attributes / options for the media article link (optional) - `imgOptions`: _array_, HTML attributes / options for the media image (optional) - `headingOptions`: _array_, HTML attributes / options for the media heading (optional) - `bodyOptions`: _array_, HTML attributes / options for the media body (optional) - `options`: _array_, HTML attributes / options for each media item (optional) |
$options | array | HTML attributes / options for the media list container |
리턴 | string |
} */ /* array commentar */ $query = Commentberita::find()->where(['KD_BERITA' => $model->KD_BERITA])->asArray()->all(); $body = []; foreach ($query as $key => $value) { # code... $foto = $value['EMP_IMG']; if ($foto == '') { $profile = '/upload/hrd/Employee/default.jpg'; } else { $profile = '/upload/hrd/Employee/' . $foto . ''; } $body[] = ['body' => "<class='box-body'><class='direct-chat-info clearfix'><div class='direct-chat-text'>" . $value['CHAT'] . "</div></div></div>", 'img' => $profile, 'imgOptions' => ['width' => "64px", 'height' => "64px", 'class' => 'img-circle'], 'srcOptions' => ['style' => ['class' => 'direct-chat-img', 'background-color' => 'rgba(0, 95, 218, 0.3)', 'width' => "70px", 'height' => "70px", 'padding-top' => '3px', 'padding-left' => '3px']]]; } $bodyHead = $this->render('_view_detailberita_headline', ['model' => $model]); $viewBt = Html::mediaList([['heading' => "<div ><div class='direct-chat-text'>" . $model->JUDUL . "</div></div", 'body' => $bodyHead, 'imgOptions' => ['width' => "84px", 'height' => "84px", 'class' => 'img-circle'], 'srcOptions' => ['style' => ['background-color' => 'rgba(0, 95, 218, 0.3)', 'width' => "90px", 'height' => "90px", 'padding-top' => '3px', 'padding-left' => '3px']], 'img' => $foto_profile, 'items' => $body]]); /* $viewBt1=Html::panel([ 'heading' => '<div></div>', // 'body'=>'<div class="panel-body">'.$foto_profile.''.$model->ISI.'</div>', 'postBody' => Html::mediaList([ [ 'heading' => $model->JUDUL, 'body' => $model->ISI, 'imgOptions'=>['width'=>"64px",'height'=>"64px",'class'=>'img-rounded'], //setting image display, 'src' => '#', 'img' => $foto_profile, 'items' => $body //"<div class='box-footer box-comments'><div class='box-comment'>".$body."</div></div>", ], ]), //'footer'=> '<div>'.$btnreply.' '.$btnclose.'</div>', // 'footer'=>Html::mediaList([
height: 450, width: 200, header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, monthNames: ['Сiчень','Лютий','Березень','Квiтень','Травень','Червень','Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], monthNamesShort: ['Сiч.','Лют.','Бер.','Квi.','Тра.','Чер.','Лип.','Сер.','Вер.','Жов.','Лис.','Гру.'], dayNames: ["Субота","Понеділок","Вівторок","Среда","Четверг","Пятница","Суббота"], dayNamesShort: ["НД","ПН","ВТ","СР","ЧТ","ПТ","СБ"], buttonText: { prev: "<", next: ">", prevYear: " << ", nextYear: " >> ", today: "Сегодня", month: "Мiсяць", week: "Тиждень", day: "День" } }); }); </script> <?php $body = 'Cras sit amet nibh libero, in gravida nulla. ' . 'Nulla vel metus scelerisque ante sollicitudin commodo. ' . 'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.'; echo Html::mediaList([['heading' => 'Media heading 1', 'body' => $body, 'src' => '#', 'img' => '/data/img/64_64.png', 'items' => [['heading' => 'Media heading 1.1', 'body' => $body, 'src' => '#', 'img' => '/data/img/64_64.png'], ['heading' => 'Media heading 1.2', 'body' => $body, 'src' => '#', 'img' => '/data/img/64_64.png']]], ['heading' => 'Media heading 2', 'body' => $body, 'src' => '#', 'img' => '/data/img/64_64.png']]); ?> </div> </div>
// $attach_image1 = BeritaImage::find()->where($condition)->All(); if ($value->EMP_IMG == "default.jpg") { $profile = '/upload/hrd/Employee/default.jpg'; } else { $profile = 'data:image/jpg;base64,' . $value->EMP_IMG; } $a = $this->render('_message_right', ['profile' => $profile, 'kd_berita' => $model->KD_BERITA, 'id' => $value->ID, 'attach_image' => $attach_image, 'messageReply' => $value->CHAT, 'jamwaktu' => date(" Y-m-d g:i a", strtotime($value->CREATED_AT)), 'nama' => $value->profile->EMP_NM, 'ttd' => $value->profile->SIGSVGBASE64, 'items' => $items, 'lampiran' => Html::panel(['body' => ''], Html::TYPE_INFO)]); $x = 0; } $body .= $a; } $body1[] = ['body' => $body, 'img' => false]; $dataProviderImageHeader = new ArrayDataProvider(['allModels' => $aryFieldHeader, 'pagination' => ['pageSize' => 5]]); /* HEADER CREATED*/ $bodyHead = $this->render('_view_detailberita_headline', ['model' => $model, 'itemHeaderAttach' => $itemHeaderAttach, 'itemDetailAttach' => $itemDetailAttach, 'dataProviderImageHeader' => $dataProviderImageHeader, 'aryFieldHeaderX' => $aryFieldHeaderX, 'id' => $id, 'ttd' => $ttdbase64, 'emp_nm' => $emp_nm, 'jam' => date('h:i A', strtotime($model->CREATED_ATCREATED_BY))]); $viewBt = Html::mediaList([['body' => $bodyHead, 'imgOptions' => ['width' => "84px", 'height' => "84px", 'class' => 'img-circle'], 'img' => $foto_profile, 'items' => $body1]]); ?> <div class="container-fluid" style="font-family: verdana, arial, sans-serif ;font-size: 8pt;"> <div class="row"> <div class="col-md-12"> <?php echo Html::panel(['heading' => "BERITA ACARA ", 'body' => $viewBt], Html::TYPE_INFO); ?> </div> </div> </div> <?php /* componen user */ $profile_user = Yii::$app->getUserOpt->profile_user()->emp; $emp_img = $profile_user->EMP_IMG;