0

I want to echo the following HTML tag:

<ul class="uk-grid" data-uk-grid-margin> 

I investigated yii2 HTML helper sources. It seems there's no possibility to echo the tag with HTML::tag() method. Am I right?

For sure I can simply do:

echo '<ul class="uk-grid" data-uk-grid-margin>';

but I am curious about different possibilities.

What is the best solution?

Vadym
  • 1,067
  • 1
  • 13
  • 24

1 Answers1

1

yes you can

<?php echo Html::tag('ul', NULL, ['class' => 'uk-grid', 'data-uk-grid-margin' => ''] ); ?>
Michael Nguyen
  • 1,691
  • 2
  • 18
  • 33
  • While this code snippet may solve the question, [including an explanation](http://meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. – Lynn Crumbling Sep 03 '15 at 21:41