Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The solutions in the <a href="https://stackoverflow.com/questions/405338/how-can-i-write-zend-framework-urls-that-have-anchor-tags-in-the-body" title="linked to post">linked to post</a> don't affect navigation because Zend_Navigation_Page_Mvc uses Zend_Controller_Action_Helper_Url and not Zend_View_Helper_Url. You have to override Zend_Controller_Action_Helper_Url::url() and then <a href="http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelper.broker" rel="nofollow noreferrer" title="add this helper to the helper broker">add your helper to the helper broker</a> for it to affect Zend_Navigation.</p> <p>In my implementation, I use a '_fragment' option/param to help prevent name conflicts:</p> <pre><code>require_once('Zend/Controller/Action/Helper/Url.php'); class My_Controller_Action_Helper_Url extends Zend_Controller_Action_Helper_Url { public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true) { $fragment = ''; if(isset($urlOptions['_fragment'])) { $fragment = '#' . $urlOptions['_fragment']; unset($urlOptions['_fragment']); } return parent::url($urlOptions, $name, $reset, $encode) . $fragment; } } </code></pre> <p>Then, in the XML file I use to configure Zend_Navigation, I create a _fragment param:</p> <pre><code>&lt;page&gt; &lt;id&gt;pageId&lt;/id&gt; &lt;label&gt;Page Label&lt;/label&gt; &lt;module&gt;foo&lt;/module&gt; &lt;params&gt; &lt;_fragment&gt;bar&lt;/_fragment&gt; &lt;/params&gt; &lt;route&gt;default&lt;/route&gt; &lt;/page&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload