ZF-10409: Zend_View_Helper_Navigation_HelperAbstract#_normalizeId(...): prefixes of A-tag IDs


The method Zend_View_Helper_Navigation_HelperAbstract#_normalizeId($value) builds IDs for the anchor tags of the navigation elements according to the following pattern:

$prefix + "-" + $value

The developer can just set the $value. The $prefix is always the lower cased name of the navigation helper type (e.g. "menu" for Menu or "breadcrumbs" for Breadcrumbs).

It would be great to have the ability to customize the complete ID and not only the part after the hyphen.


The patch should include the following points:

  • Zend_View_Helper_Navigation_HelperAbstract gets a new property "prefixForId" and getter and setter for this property
  • Zend_View_Helper_Navigation_HelperAbstract gets a new option to skip the prefix (bool)
  • Zend_View_Helper_Navigation_HelperAbstract::_normalizeId() uses/extends Zend_View_Helper_HtmlElement::_normalizeId()

Fixed in trunk (1.12.0): r24962 (by Adam Lundrigan)