2015-03-31 91 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); 
相關問題