Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.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
Redirect 我的$this有什么问题->;在这段代码中重定向(…)调用?_Redirect_Controller_Typo3_Extbase - Fatal编程技术网

Redirect 我的$this有什么问题->;在这段代码中重定向(…)调用?

Redirect 我的$this有什么问题->;在这段代码中重定向(…)调用?,redirect,controller,typo3,extbase,Redirect,Controller,Typo3,Extbase,我有两个扩展,我想在某个动作中从一个重定向到另一个。这是我的BPSMessageCenter扩展的bpsmessagecontroller的saveAction中的重定向代码: $this->redirect('list', 'Coupon', 'Bpscoupons', array('message' => 'Look Ma, no syntax errors!' )); 当它运行时,它只是重定向回呼叫分机(bpsmessagecenter)的列表页面,它似乎根本找不到BPSC

我有两个扩展,我想在某个动作中从一个重定向到另一个。这是我的BPSMessageCenter扩展的bpsmessagecontroller的saveAction中的重定向代码:

 $this->redirect('list', 'Coupon', 'Bpscoupons', array('message' => 'Look Ma, no syntax errors!' ));
当它运行时,它只是重定向回呼叫分机(bpsmessagecenter)的列表页面,它似乎根本找不到BPSChopons分机

当我用转发调用而不是重定向尝试相同的代码时,我得到一个500错误

“列表”操作可以通过站点上的链接和BPSChopons扩展内的其他重定向访问和工作

为什么重定向不起作用?我是否需要在某个地方配置内部或外部重定向

我使用的是typo3 4.5.32。 谢谢

顺便说一句,在我的查询字符串中,我看到我得到了以下参数:

tx_bpscoupons_bpsmessagecentre[message]:Hi ma... etc
tx_bpscoupons_bpsmessagecentre[action]:list
tx_bpscoupons_bpsmessagecentre[controller]:Coupon 

在我看来,它正在寻找一个bpsmessagecentre对象一个BPSChopons对象,但我不知道。

这两个插件在同一页上吗?如果不是这样,您还必须传递目标页面的PageId,因为extbase conroller中的$this->redirect采用以下参数:

/**
 * Redirects the request to another action and / or controller.
 *
 * @param string $actionName Name of the action to forward to
 * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
 * @param string $extensionName Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
 * @param array $arguments Arguments to pass to the target action
 * @param integer $pageUid Target page uid. If NULL, the current page uid is used
 * @param integer $delay (optional) The delay in seconds. Default is no delay.
 * @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other"
 */    
protected function redirect(
        $actionName,
        $controllerName = NULL,
        $extensionName = NULL,
        array $arguments = NULL,
        $pageUid = NULL, 
        $delay = 0, 
        $statusCode = 303
    )

我认为扩展名应该以小写字母开头。

谢谢,这很有帮助,我现在可以使用paegid进入列表操作,但我无法进入新操作,调用新操作有什么不同吗?可能与传递类的实例有关?您所说的“无法进行新操作”是什么意思。有例外吗?如果目标站点上的插件配置为允许“新建”操作,则其工作方式应与列表操作相同。对新操作的调用将删除列表操作-但没有例外,这就是我现在的调用:$this->redirect(‘新’、‘优惠券’、‘BPSChopons’、数组('new优惠券'=>null,'message'=>'创建新优惠券后,您的邮件已保存,返回邮件。','bpsmessageid'=>$bPSMessage->getUid()),44);好的,我必须在重定向之前添加这一行。$this->request->setPluginName('bpshoupons');现在可以了\