Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法重定向到自定义模块中magento中的其他页面_Php_Magento_Zend Framework_Http Redirect - Fatal编程技术网

Php 无法重定向到自定义模块中magento中的其他页面

Php 无法重定向到自定义模块中magento中的其他页面,php,magento,zend-framework,http-redirect,Php,Magento,Zend Framework,Http Redirect,我已经创建了用于测试的模块,并尝试从url调用编校操作。所有配置都完成了,一切正常,但是。在我的redme操作中,magento不重定向到其他页面 <?php class Test_Demo_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { $this->loadLayout(); $blo

我已经创建了用于测试的模块,并尝试从url调用编校操作。所有配置都完成了,一切正常,但是。在我的redme操作中,magento不重定向到其他页面

<?php

class Test_Demo_IndexController extends Mage_Core_Controller_Front_Action
{

    public function indexAction()
    {
        $this->loadLayout();     
        $block = $this->getLayout()->createBlock('capacityweb/Test','Test',array('template' => 'capacity/web/test.phtml'));
        $this->getLayout()->getBlock('content')->append($block);
        $this->renderLayout();
    }

public function redmeAction()
    {
    $this->loadLayout();     
    $this->renderLayout();

    $action=$this->getRequest()->getParam('action');        
    $id=$this->getRequest()->getParam('id');


    if($action!=null && $id!=null)
    {
    $relContact = Mage::getModel('catalog/product')->getCollection();   
    }

    Mage::app()->getFrontController()->getResponse()->setRedirect("http://google.com");
}

} 
但无法重定向。

尝试使用以下方法:

$this->_redirectUrl('http://google.com');
而不是

Mage::app()->getFrontController()->getResponse()->setRedirect("http://google.com"); 

但不能重定向到另一个页面。这样,config.xml中是否需要更改配置?这意味着您的代码中有一些输出。在大多数情况下,这是由于关闭类文件中的php标记(
?>
)并在其后面有空格或新行引起的。
Mage::app()->getFrontController()->getResponse()->setRedirect("http://google.com");