2017-04-24 112 views
0

所有项目一天前运行良好,我无法更改任何系统文件或类似的东西。但现在刀片如果陈述不起作用。如果Laravel Blade上的语句无法正常工作

我的刀片代码

<html> 
<body> 
@if($success == "True") 
      <script> 
       window.parent.successPayment(); 
      </script> 
@else 

      <script> 
       window.parent.failedPayment("{{$message}}"); 
      </script> 

@endif 

渲染

<html> 
<body> 
     @if ($success == "True") 
      <script> 
       window.parent.successPayment(); 
      </script> 
     <?php else: ?> 

      <script> 
       window.parent.failedPayment("<?php echo e($message); ?>"); 
      </script> 

     <?php endif; ?> 


</body> 
</html> 

如果没有声明后呈现。我无法解决这个问题。任何人都知道如何解决这个问题?

解析错误:语法错误,意外的'endif'(T_ENDIF),期待文件结束(View:/var/www/vhosts/mysite.site/mysite.site/resources/views/dashboard/test.blade。 php)

+0

尝试运行过程中出现的PHP'工匠视图:clear'。 –

+0

您使用的是哪个版本的PHP,并检查了您正在使用的Laravel版本的最低要求。 –

回答

0

试试吧。

<html> 
<body> 
     @if ($success == "True") 
      <script> 
       window.parent.successPayment(); 
      </script> 
     @else 

      <script> 
       window.parent.failedPayment("{{ e($message) }}"); 
      </script> 

     @endif 

</body> 
</html> 
0

Intresting

class DashboardBaseController extends Controller 
{ 

    public function __construct(){ 
//  setlocale(LC_TIME, "turkish"); 
//  setlocale(LC_ALL,'turkish'); 
// 
    $this->middleware(function ($request, $next) { 
     $user = Auth::user(); 
     $img = DefaultProfileImage::create($user->name, 256, "#e91e63"); 
... 

如果我评论的setlocale行代码正常工作。

0

尝试这一个

 <html> 
     <body> 
     <?php if ($success == "True") {?> 
      <script>    window.parent.successPayment(); 
      </script> 

     <?php } 

else: {?> 
      <script>  window.parent.failedPayment("<?php echo  e($message); ?>"); 
      </script> 

    <?php }  endif;  ?> </body> 

    </html> 
+0

代码正在工作。 setlocale是问题。我现在评论这条线和刀片工作 –