Example #1
0
 /**
  * @param Community $community
  *
  * @return string
  * @throws \Exception
  */
 public function __invoke(Community $community)
 {
     $uri = '<a href="%s" title="%s" class="%s">%s</a>';
     $img = '<img src="%s">';
     $classes = [];
     $link = preg_replace('/^([^\\~]+)(\\~(.*))?$/', '${1}' . $community->getCommunity() . '$3', $community->getType()->getLink());
     return sprintf($uri, $link, sprintf($this->translate("txt-go-to-%s-profile"), $community->getType()->getType()), implode($classes), sprintf($img, $this->getUrl('assets/style-image', array('source' => $community->getType()->getImage()))));
 }