Issues

ZF-8522: Add ability to include "#" in route generation

Description

It would be excellent to be able to include "#" as part of a URL in route generation. For example, it is currently not possible to generate a route with a hash in it to take a user to a certain anchor within a page.

This would then be supported by the url() view and action helpers. Possible use case from an action would be:

<?php // Generate URL to http://mysite.com/documentation/blog/tags/#add

$routeArgs = array( 'module' => 'documentation', 'controller' => 'blog', 'action' => 'tags', 'anchor' => 'add', );

$this->_helper->redirector->gotoRoute($routeArgs);

// or from a view echo $this->url($routeArgs);

Currently the only way to accomplish this in an action is to create a URL with the URL helper, append the anchor string to it, call setPrependBase() to "" in redirector helper (this prevents the baseUrl from being prepended twice to the URL, then call ->gotoUrl() on the redirector helper.

See discussion from the mailing list here: http://n4.nabble.com/Adding-a-to-a-URL-using-gotoR…

Comments

I will add a solution for this in the new router system.