Just stumbled on an odd quirk and wondered if its me being an idiot or an unhappy inconsistency. The two tags below are technically equivelant, however only the second properly generates the SVG inside the anchor. The first spits it out the svg code as a string. What gives? I would prefer to do the first, since it is more concise.
<?= Html::a($next->url(), svg('assets/images/RightArrow.svg'), ['class' => 'btn' ]); ?>
<?= Html::tag('a', [svg('assets/images/RightArrow.svg')], ['class' => 'btn', 'href' => $next->url() ]) ?>
Edit: just noticed that it does work if you wrap the the svg()
in square brackets, but this information is missing from the docs. It does the value can be mixed, but a couple of examples on that page would be useful.
<?= Html::a($next->url(), [svg('assets/images/RightArrow.svg')], ['class' => 'btn' ]); ?>