ZF-8922: Adding an Anchor property to Zend_Navigation_Page_Mvc

Description

Currently, Zend_Navigation_Page_Mvc has no way of appending an anchor link, such as http://example.com/About#who, without subclassing the framework, or using the more general but less useful Zend_Navigation_Page_Uri.

I think it'd be a good idea to add an "anchor" field to Zend_Navigation_Page_Mvc. That way, the above url could be generated from:


Blah
    Aboutindexwho

Comments

This feature is still missing in 1.10.

The patch should include the following points:

  • Zend_Navigation_Page gets a new property "anchor" and getter and setter for this property
  • Zend_View_Helper_Navigation_HelperAbstract::htmlify uses the new property from the page
  • Zend_View_Helper_Navigation_HelperAbstract gets a new option to the output of anchors to skip

Update:

This is not an "anchor"! It is a "fragment identifier".

Another description for "fragment identifier": Wikipedia - Fragment identifier

Any comments on this?

{quote} Any comments on this? {quote} I agree with you. Here's another source: RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax - 3.5. Fragment

Fix and unit tests added.

Fixed in r24440 - ported to ZF2 via PR