chr*_*lee 1 php redirect zend-framework
是否可以通过使用zend方法重定向视图脚本?
或者使用php重定向会更简单: <?php header('Location: $myurl') ?>
在您的控制器中(使用位置标题):
$this->_redirect($url);
Run Code Online (Sandbox Code Playgroud)
要么
$redirector = $this->getHelper('Redirector');
/* @var $redirector Zend_Controller_Action_Helper_Redirector */
$redirector->gotoUrl($url);
Run Code Online (Sandbox Code Playgroud)
你也可以用:
$redirector->gotoRoute(
array(
'action' => 'my-action',
'controller' => 'my-controller'
)
);
Run Code Online (Sandbox Code Playgroud)
如果要使用与默认值不同的视图脚本:
$this->renderScript('/my-controller/my-view.phtml');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7655 次 |
| 最近记录: |