Instead of having just brandLabel text in my navbar, I would like to insert logo there. From reading the documentation for yii\bootstrap\NavBar, I do not see how this can be done. Can someone help please ?
Instead of having just brandLabel text in my navbar, I would like to insert logo there. From reading the documentation for yii\bootstrap\NavBar, I do not see how this can be done. Can someone help please ?
According to the docs, brandLabel is not HTML encoded, so you can put an image tag in there.
I have tried this:
'brandLabel' => Html::img('logo.png'),
But image is not displayed, I get only empty box, but once I click on it image is displayed. What am I doing wrong ?
Try to add slash
'brandLabel' => Html::img('/logo.png'),
Just give it a width property. I got tricked for a minute too.