Yii2 data tool tip for images in a grid view
<p>This is related to my previous question. I want a tool-tip title to be displayed dynamically for my images when I hover over the images. I have explained the relationships in my previous question <a href="https://stackoverflow.com/questions/38635197/yii2-display-multiple-images-in-gridview-row/38637328#38637328">Click here</a>. Now I want to add data tool tip to those images. My code is below </p>

<pre><code>  [
        'label' =&gt; 'Hazards',  
        'format' =&gt; 'raw',   
        'value' =&gt; function ($data) {
             $images = '';

    // append all images
            foreach($data-&gt;getPictogramName() as $name)     
                foreach ($data-&gt;getPictogramUrl() as $url)                   
                $images = $images.Html::img($url,['alt'=&gt;'','width'=&gt;'30','height'=&gt;'30', 'data-toggle'=&gt;'tooltip','data-placement'=&gt;'left','title' =&gt; $name ,'style'=&gt;'cursor:default;']);
            return $images;

        }
  ],
</code></pre>

<p>The issue is when i loop through the name. Every image is displayed twice. There is some looping issue. Can any1 help me find the solution . Thanks</p>