D
D
dev4002017-01-12 19:53:27
Yii
dev400, 2017-01-12 19:53:27

Detailview yii2 how to edit link template?

Widget

<?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'title',
            'keywords',
            'description',
            'text:ntext',
            ['attribute' => 'url', 'label' => 'Адрес', 'format' => 'url']
        ],
    ]) ?>

The "url" attribute is displayed in the following format: How to form a link normally?
<td><a href="http://main-page">main-page</a></td>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-01-12
@dev400

How to generate a link?

What do you mean by normal? set certain html attributes for a link?
then you can do it like this:
[
    'attribute' => 'url', 
    'label' => 'Адрес', 
    'format' => [
        'url', 
        ['class' => 'ppp']
    ]
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question