2015-03-31 61 views
1

我有laravel上的返回重定向问题4.如何返回错误重定向?如何返回laravel上的重定向

public function Verify($data) 
{ 
    try 
    { 
     $this->_initSoap($data['store_url']); 
    } catch (\SoapFault $e) { 
     // login failed logic 
     $faultcode = $e->faultcode; // ex: 2 
     $message = $e->faultstring; // ex: Access denied. 
     //die('aaaa'. $message);// return redirect, etc... 
     return \Redirect::to('user/stores/magento')->with('error', $message); 
    } 
} 

我有这样的

ErrorException (E_UNKNOWN) 
Header may not contain more than a single header, new line detected 

Open: /var/www/haroldas.ggggg.com/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php 

     // status 
     header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode); 

     // headers 
     foreach ($this->headers->allPreserveCase() as $name => $values) { 
      foreach ($values as $value) { 
       header($name.': '.$value, false, $this->statusCode); 
      } 
     } 

回答

1

您是否尝试过使用的背法的重定向问题?

尝试

Return \Redirect::back()->with('error', $message); 
相关问题