Better usability when switching between detail and list views
You can enhance the usability of your web page or application when redirecting from a detail view back to a list view by scrolling the list to the entry that was just edited. This is done with a fragment identifier in the URL, also called "anchor" and a matching id in each of the entries in the list.
Let's say your list view looks like this:
<div id="entry_1"> Big chunk of text 1. </div> ... <div id="entry_42"> Big chunk of text 42. </div>
To scroll the list to entry number 42, you must create a URL like this: http://example.com/#entry_42
However, the standard URL and redirection helpers like gotoSimpleAndExit in the current Zend Framework release don't have a parameter for fragment identifiers. But it's possible to use gotoUrlAndExit and add the fragment to a generated URL:
$url = $this->_helper->url('index', 'entries').'#entry_'.$id; $this->_redirector->gotoUrlAndExit($url, array('prependBase' => false));
The prependBase is important, otherwise the base URL will be added twice, if you have it configured.
Neueste Kommentare
vor 37 Wochen 6 Tage
vor 38 Wochen 4 Tage
vor 1 Jahr 6 Tage