示例#1
0
 /**
  * Get the html for an anchor
  * @param string $href the href of the anchor
  * @param string $label the label for the anchor
  * @param boolean $translate true to translate the label
  * @param string $class Style class for the anchor
  * @return string html of the anchor
  */
 private function getAnchorHtml($href, $label, $translate, $class = null, $id = null, $title = null)
 {
     if ($translate) {
         $label = $this->translator->translate($label);
     }
     if ($href != '#') {
         $href = $this->baseUrl . Module::ROUTE_JOPPA . $href;
     }
     if (!$label) {
         $label = 'N/A';
     }
     $anchor = new Anchor($label, $href);
     if ($id) {
         $anchor->setId($id);
     }
     if ($class) {
         $anchor->appendToClass($class);
     }
     if ($title) {
         $anchor->setAttribute('title', $title);
     }
     return $anchor->getHtml();
 }