T
T
Tatiana Komarova2016-07-13 21:26:27
Yii
Tatiana Komarova, 2016-07-13 21:26:27

Why does attribute order change when registerLinkTag Yii2?

I register the tag in the controller:

Yii::$app->view->registerLinkTag(['rel' => 'canonical', 'href' => 'http://mylink']);

The code renders:
<link href="http://mylink" rel="canonical">
Why are the attributes swapping? I need rel to come first.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tatyana Komarova, 2016-07-13
@tatia_kom

All found. In the $attributeOrder parameter of the BaseHtml class, the attributes were arranged in a certain (weird) order.

V
vyachin, 2016-07-13
@vyachin

because the letter h comes before the letter r in the English alphabet

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question