Beispiel #1
0
 public function formatToken(Token $token)
 {
     $attrs = array();
     $color = isset($this->colors[$token->getType()]) ? $this->colors[$token->getType()] : $this->colors[Token::TYPE_PLAIN_TEXT];
     $attrs['style'] = 'color: ' . $color;
     $description = $token->getDescription();
     if ($description) {
         $attrs['title'] = htmlentities($description);
     }
     return $this->formatTag($token->getValue(), $attrs);
 }
Beispiel #2
0
 public function formatToken(Token $token)
 {
     return $token->getDescription() ?: $token->getValue();
 }