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


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

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


// 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:…


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