Html:: tag helper

This is going to sound really picky… but ill say it anyway :slight_smile:

ive made a meta tag snippet which has a bunch of lines like this…

 <?= Html::tag('meta', null, ["name" => "keywords", "content" => $metakeywords]).PHP_EOL ?>

However, in the generated HTML it seems to always put the content before the name. Its as if its alpha sorting the array, instead of respecting the order they were declared in. In the case of meta tags, its harder to read the html in view source, and spot if one is missing, becase the name is on the end.

Is there anything i can do about it? Like i said… picky… but i would prefer it to come out in the oder declared. I can of course read the snippet, and thats fine… but it still irks me its in a different order in the output.

That’s exactly what it’s doing.

You could extend the Html class, override the attr() method and then use that child class instead.