Reputation: 19
In forum i see this is not yii2 standard <?= $var ?>
.
Yii2 standard code is <?= Html::encode($var) ?>
.
Anyone know use of Yii2 html helper class?
Upvotes: 2
Views: 252
Reputation: 133360
The content of <?= $var ?>
, tipically is not encoded automatically by yii2 so the values of the $var will be HTML-encoded using
Html::encode($var).
For a useful guide about HtmlHelpers you can see this doc
http://www.yiiframework.com/doc-2.0/guide-helper-html.html
and this ref ..
http://www.yiiframework.com/doc-2.0/yii-helpers-html.html
http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html
Yii2 provide a useful set of Html helpers for a easy code manipulation
l
Upvotes: 3