0

введите сюда описание изображения

https://cdn1.savepice.ru/uploads/2019/12/2/02923edf1b7d7df73c42f9db8fab5ab5-full.png

<?php $img = $model->getImage(); ?>
    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'category_id',
            'name',
            'content:html',
            'price',
            'keywords',
            'description',
            [
                'attribute' => 'image',
                'value' => "<img src='{$img->getUrl()}'>",
                'format' => 'html',
            ],
            'hit',
            'new',
            'sale',
        ],
    ]) ?>

введите сюда описание изображения

[
   'attribute' => 'image',
   'value' => "<img src='{$img->getUrl()}'>",
   'format' => 'raw',
],
1
  • а картинка по ссылке существует? 3 дек 2019 в 13:01

1 ответ 1

0

Попробуйте так. И проверьте что собственно выводиться

echo $model->getImage()->getUrl();

<?= DetailView::widget([
    'model' => $model,
    'attributes' => [
        'id',
        'category_id',
        'name',
        'content:html',
        'price',
        'keywords',
        'description',
        [
            'attribute' => 'image',
            'value' => "<img src='{$model->getImage()->getUrl()}'>",
            'format' => 'html',
        ],
        'hit',
        'new',
        'sale',
    ],
]) ?>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.