我是laravel的新手,但是我发现了一些很奇怪的东西。Laravel v3.2.13-5刀片模板不起作用
在我的刀模板我写道:
@if($appModule == 'someting')
Something
@elseif($appModule == 'somethingelse')
SomethingElse
@else
Nothing
@endif
当我跑我得到一个错误:
Unhandled Exception
Message:
Error rendering view: [layout]
syntax error, unexpected '?' Location:
...\storage\views/a5d6961979ebea7e1177c3836de35dd8 on line 41
我打开 'a5d6961979ebea7e1177c3836de35dd8',发现这个:
<?php if($appModule == 'someting') Something <?php else: ?>if($appModule == 'somethingelse'): ?> SomethingElse <?php else: ?> Nothing <?php endif; ?>
的错误在这里:“<?php if($ appModule =='someting')Something <?php else:?> if”我不明白为什么刀片不能正确编译... – 2013-02-19 20:10:14
是的 - 我注意到那 - 也许它是由你的观点中其他地方的代码引起的。如果只有IF语句的观点,会发生什么?它是否正确编译? – Laurence 2013-02-19 20:24:25
我刚刚尝试过,我注意到如果我只有\ @if \ @endif一切正常,但如果我有\ @if \ @elseif \ @endif它会导致错误! – 2013-02-19 20:33:59