如何使用Zend Framework重定向到以下URL?重定向到一个页面并滚动到特定div
http://hms.localhost.com/booking/room#availableResults
我无法使用Java脚本。这需要使用Zend Framework Controller helper完成,例如rediretor();
如何使用Zend Framework重定向到以下URL?重定向到一个页面并滚动到特定div
http://hms.localhost.com/booking/room#availableResults
我无法使用Java脚本。这需要使用Zend Framework Controller helper完成,例如rediretor();
从控制器:
$this->_redirect('/booking/room#availableResults');
设置你的div id作为availableResults
<div id="availableResults">
...
..
..
用于通过Zend的,先打@谷歌在笨重定向
$url = 'http://hms.localhost.com/booking/room#availableResults';
redirect($url);
确定:
的gotoRoute()方法不支持散列,但你可以通过使用url动作助手来构建基于你的路线的URL,然后连接你的散列到它。然后调用重定向器的gotoUrl方法:
$url = $this->_helper->url->url(array('module' => 'blog',
'controller' => 'documentation', 'action' => 'tags'));
$url .= "#add";
$this->_helper->redirector->gotoUrl($url);
我需要在Zend Framework中使用控制器来做到这一点...我无法使用javascript。 – 2013-03-13 11:28:41
再次看看@我的回答:) – 2013-03-13 11:32:57
在div id的视图脚本都准备好了一套....我需要从我的控制器重定向... – 2013-03-13 11:25:09