1. Christoffer Niska
  2. yii-bootstrap
Issue #10 resolved

uneditableField don't support htmlAttributes

Anonymous created an issue

{{{

!php

protected function uneditableField()
{
    echo $this->getLabel();
    echo '<span class="uneditable-input">'.$this->model->{$this->attribute}.'</span>';
    echo $this->getError().$this->getHint();
}

}}}

Your native function don't provide any support to htmlAtributtes I have fixed this the function:

{{{

!php

protected function uneditableField()
{
    if(is_array($this->htmlOptions))
    {
        if(isset($this->htmlOptions['class']))
            $this->htmlOptions['class'] .= ' uneditable-input';
        else
            $this->htmlOptions['class'] = 'uneditable-input';
    }
    else
    {
        $this->htmlOptions = array('class'=>'uneditable-input');
    }
    echo $this->getLabel();
    //echo '<span '.$this->htmlOptions.'>'.$this->model->{$this->attribute}.'</span>';
    echo CHtml::tag('span',$this->htmlOptions, $this->model->{$this->attribute});
    echo $this->getError().$this->getHint();
}

}}}

it works to me Thanks

Comments (2)

  1. Log in to comment