예제 #1
0
 /**
  * Special override that prints priority accordingly
  * @param type $fieldName
  * @param type $makeLinks
  * @param type $textOnly
  * @param type $encode
  * @return type
  */
 public function renderAttribute($fieldName, $makeLinks = true, $textOnly = true, $encode = true)
 {
     $render = function ($x) use($encode) {
         return $encode ? CHtml::encode($x) : $x;
     };
     switch ($fieldName) {
         case 'stageNumber':
             $workflowStage = $this->workflowStage;
             if ($workflowStage) {
                 return $render($workflowStage->name);
             } else {
                 return null;
             }
         case 'priority':
             return $render($this->getPriorityLabel());
         default:
             return parent::renderAttribute($fieldName, $makeLinks, $textOnly, $encode);
     }
 }