コード例 #1
0
ファイル: Menu.php プロジェクト: BGCX262/zym-svn-to-git
    /**
     * Returns HTML anchor for the given pages
     *
     * @param  Zym_Navigation_Page $page  page to get anchor for
     * @return string
     */
    public function getPageAnchor(Zym_Navigation_Page $page)
    {
        // get label and title for translating
        $label = $page->getLabel();
        $title = $page->getTitle();
        
        if ($this->_useTranslator && $t = $this->_getTranslator()) {
            $label = $t->translate($label);
            $title = $t->translate($title);
        }
        
        // get attribs for anchor element
        $attribs = array(
            'id'     => $page->getId(),
            'title'  => $title,
            'class'  => $page->getClass()
        );

        $href = $page->getHref();

        if ($href) {
            $attribs['href'] = $href;
            $attribs['target'] = $page->getTarget();
            $element = 'a';
        } else {
            $element = 'span';
        }

        return '<' . $element . ' ' . $this->_htmlAttribs($attribs) . '>'
             . $this->getView()->escape($label)
             . '</' . $element . '>';
    }
コード例 #2
0
ファイル: Menu.php プロジェクト: BGCX262/zym-svn-to-git
 /**
  * Returns HTML anchor for the given pages
  *
  * @param  Zym_Navigation_Page $page  page to get anchor for
  * @return string
  */
 public function getPageAnchor(Zym_Navigation_Page $page)
 {
     // get attribs for anchor element
     $attribs = array('id' => $page->getId(), 'title' => $page->getTitle(), 'class' => $page->getClass());
     $href = $page->getHref();
     if ($href) {
         $attribs['href'] = $href;
         $attribs['target'] = $page->getTarget();
         $element = 'a';
     } else {
         $element = 'span';
     }
     return '<' . $element . ' ' . $this->_htmlAttribs($attribs) . '>' . $page->getLabel() . '</' . $element . '>';
 }
コード例 #3
0
 /**
  * Returns HTML anchor for the given pages
  *
  * @param  Zym_Navigation_Page $page  page to get anchor for
  * @return string
  */
 public function getPageAnchor(Zym_Navigation_Page $page)
 {
     // get attribs for anchor element
     $attribs = array('id' => $page->getId(), 'title' => $page->getTitle(), 'class' => $page->getClass(), 'href' => $page->getHref(), 'target' => $page->getTarget());
     return '<a ' . $this->_htmlAttribs($attribs) . '>' . $page->getLabel() . '</a>';
 }