protected function getId(Zend_Navigation_Page $page) { $id = $page->getId(); if (!empty($id)) { return $id; } if ($page instanceof Zend_Navigation_Page_Mvc) { return sprintf('%s-%s', $page->getController(), $page->getAction()); } elseif ($page instanceof Zend_Navigation_Page_Uri) { return crc32($page->getUri()); } }
/** * 根据Zend_Navigation_Page对象生成资源字符串 * * @static * @param Zend_Navigation_Page $page * @return string */ public static function parseNavigationPage(Zend_Navigation_Page $page) { if ($page instanceof Zend_Navigation_Page_Mvc) { $mvc = array($page->getModule(), $page->getController(), $page->getAction()); return implode(self::SEPARATOR, array_filter($mvc)); } else { if ($page instanceof Zend_Navigation_Page_Uri) { return self::parseUri($page->getUri()); } } return $page->getResource(); }