1. Christoffer Niska
  2. yii-bootstrap
  3. Issues
Issue #260 new

TbHeroUnit issue when heading is null

Anonymous created an issue

TbHeroUnit generates an empty H1 tag when heading is null because of CHtml::encode before isset($this->heading). CHtml::encode converts NULL to an empty string, so then isset returns TRUE (because an empty string is not a null). So, the code should be fixed as follows:

    echo CHtml::openTag('div', $this->htmlOptions);

    if (isset($this->heading)) {
        if ($this->encodeHeading) {
        $this->heading = CHtml::encode($this->heading);
        echo CHtml::tag('h1', $this->headingOptions, $this->heading);

Comments (0)

  1. Log in to comment