protected function renderDateTime($field, $makeLinks, $textOnly, $encode)
 {
     $fieldName = $field->fieldName;
     if (empty($this->owner->{$fieldName})) {
         return ' ';
     } elseif (is_numeric($this->owner->{$fieldName})) {
         return X2Html::dynamicDate($this->owner->{$fieldName});
     } else {
         return $this->render($this->owner->{$fieldName}, $encode);
     }
 }
Exemplo n.º 2
0
 public function renderAttribute($name)
 {
     switch ($name) {
         case 'name':
             echo $this->relatedModel->getLink();
             break;
         case 'relatedModelName':
             echo $this->getRelatedModelName();
             break;
         case 'assignedTo':
             echo $this->relatedModel->renderAttribute('assignedTo');
             break;
         case 'label':
             echo $this->label;
             break;
         case 'createDate':
             echo isset($this->createDate) ? X2Html::dynamicDate($this->createDate) : '';
             break;
     }
 }