Hello friends
I’m studying the chapter 6 and I have a doubt
I put this code in Issue class:
public function getStatusText()
{
$statusOptions=$this->statusOptions;
return isset($statusOptions[$this->status_id]) ? $statusOptions[$this->status_id] : "unknow status ({$this->status_id})";
}
public function getTypeText()
{
$typeOptions=$this->typeOptions;
return isset($typeOptions[$this->type_id]) ? $typeOptions[$this->type_id] : "unknow type ({$this->type_id})";
}
and this in _view of Issue:
<b><?php echo CHtml::encode($data->getAttributeLabel('type_id')); ?>:</b>
<?php echo CHtml::encode($data->getTypeText()); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('status_id')); ?>:</b>
<?php echo CHtml::encode($data->getStatusText()); ?>
<br />
This code change the display, after this code was diplay number, when I put this code display the text.
Please. Can anyone explain the code? I don’t understand