Example #1
0
 public function getHtml()
 {
     $count = count($this->_data);
     $i = 0;
     $html = '';
     // check ignoreSinglePage
     if (count($this->_data) == 1 && Zmz_Breadcrumbs::getInstance()->getIgnoreSinglePage()) {
         return $html;
     }
     if (count($this->_data)) {
         $html .= '<ul class="breadcrumb">';
         foreach ($this->_data as $title => $value) {
             $i++;
             $active = @$value['active'] ? 'class="active"' : '';
             $html .= "<li {$active}>";
             if (@$value['url']) {
                 $html .= '<a href="' . @$value['url'] . '">' . $title . '</a>';
             } else {
                 $html .= $title;
             }
             $html .= '</li>';
             if ($i < $count) {
                 $html .= '<span class="divider">/</span>';
             }
         }
         $html .= '</ul>';
     }
     return $html;
 }
Example #2
0
 /**
  * Get singleton instance
  * 
  * @return Zmz_Breadcrumbs 
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }