如何使用yii2通过图像链接呈现另一个控制器方法?

如何使用yii2通过图像链接呈现另一个控制器方法?,yii2,Yii2,以下代码将渲染图像: <?= Html::img('@web/img/accept_all_you_see-wallpaper-1680x1050.jpg', ['alt' => 'PicNotFound', 'class' => 'scale-with-grid wp-post-image', 'style' => 'width:960;height:700']); ?> 下面的代码将图像渲染为链接 <?= Html::a('', Yii::getAl

以下代码将渲染图像:

<?= Html::img('@web/img/accept_all_you_see-wallpaper-1680x1050.jpg', ['alt' => 'PicNotFound', 'class' => 'scale-with-grid wp-post-image', 'style' => 'width:960;height:700']); ?>

下面的代码将图像渲染为链接

<?= Html::a('', Yii::getAlias('@web') . '/img/pic1.jpg', ['target' => '_blank', 'alt' => 'PicNotFound', 'class' => 'icon-search']) ?>

如果我想通过单击图像来渲染另一个Conroller方法,如何编码? 下面的代码将通过引导图标而不是图像来实现我的意图

<div class="col-md-12">
    <?= Html::a('<span class="glyphicon glyphicon-paperclip"></span>', ['/dateianhang/dateianhang/index'], ['title' => 'Anlagen anzeigen', 'data' => ['pjax' => '0']]); ?>
</div>




效果很好。谢谢你的解决方案。我给你的努力加了2分!不,如果你不需要它,就不要用它。这主要取决于你的布局和风格。通常
Html::img('@web/img/accept\u all\u you\u see-wallper-1680x1050.jpg')
对于图像来说已经足够了。效果非常好。谢谢你的解决方案。我给你的努力加了2分!不,如果你不需要它,就不要用它。这主要取决于你的布局和风格。通常
Html::img('@web/img/accept_all_you_see-wallper-1680x1050.jpg')
对于图像来说已经足够了。
<?= Html::a(
    Html::img(
        '@web/img/accept_all_you_see-wallpaper-1680x1050.jpg',
        ['alt' => 'PicNotFound', 'class' => 'scale-with-grid wp-post-image', 'style' => 'width:960;height:700']
    ),
    ['/dateianhang/dateianhang/index'],
    ['title' => 'Anlagen anzeigen', 'data' => ['pjax' => '0']]
) ?>