예제 #1
0
 /**
  * Get the HTML label of the attribute.
  *
  * The difference with the label() method is that the label method always
  * returns the HTML label, while the getLabel() method is 'smart', by
  * taking the self::AF_NOLABEL and self::AF_BLANKLABEL flags into account.
  *
  * @param array $record The record holding the value for this attribute.
  * @param string $mode The mode ("add", "edit" or "view")
  *
  * @return string The HTML compatible label for this attribute, or an
  *                empty string if the label should be blank, or NULL if no
  *                label at all should be displayed.
  */
 public function getLabel($record = [], $mode = '')
 {
     if ($mode == 'view' && $this->hasFlag(self::AF_BLANK_LABEL | self::AF_BOOL_INLINE_LABEL)) {
         return $this->label();
     } else {
         return parent::getLabel($record);
     }
 }