标头的最佳方法在Laravel5.2视图文件中的位置

时间:2016-07-18 20:29:20

标签: php header laravel-5.2 soap-client

我在Laravel -> resources -> view文件中使用soap客户端PHP7连接到银行付款方式,我的肥皂客户端已启用。

我在视图文件中的代码是这样的:

if ($result->Status == 100) 
    header('Location: https://domain.com/Pay/'.$result->Authority);
else 
echo 'false';

但是标题不起作用!!!我也使用redirect() - Redirect::to() - Redirect::away(),但没有为我工作!!!!! (惊人)

解决这个问题的最佳方法是什么?

谢谢你们

1 个答案:

答案 0 :(得分:0)

我可以找到我的问题!我认为这太棒了

我刚刚添加了标题loaction的die();结尾,例如:

if ($result->Status == 100) 
header('Location: https://domain.com/Pay/'.$result->Authority) or die();

它对我有用!!!