Strange TbHtml behaviour inside Modal

Hello there

I just included yiistraps TbHtml class in order to use the alert() function. This works well anywhere else but inside a modal.

Code:


echo TbHtml::alert(TbHtml::ALERT_COLOR_WARNING, 'Test');

Normal output:




<div class="alert alert-warning in fade">

<a class="close" data-dismiss="alert" href="#">×</a>

Test

</div>



what gets created when inside a modal:




<div class="alert alert-warning in alert-block fade"></div>

<a class="close" data-dismiss="alert" href="#">×</a>

Test



Does anyone have an explanation or even solution for this?

Thanks

Simon

Hm I have now seen this behaviour also when for example using TbHtml::progressBar() anywhere. In the TbHtml class, it looks like this:


ob_start();

echo self::openTag('div', $htmlOptions); //directly outputs <div ....></div>

echo self::bar($width, $barOptions);

echo '</div>';  // Just like this line was moved up one line

return ob_get_clean();

For an (I know it’s bad) fix I have now modified this class like this:


ob_start();

echo self::tag('div', $htmlOptions, self::bar($width, $barOptions)); 

return ob_get_clean();

this way it works like it should…

somebody an idea how this is possible?