Closed austinkregel closed 9 years ago
Hia, I was trying to do some inline php and for some reason the <? is trying to echo out. I'd love to be able to do my inline comparison.
<?
This is what is in my haml.blade.php
@if($dev->status === "flash") <?php $stat = "danger"?> @else <?php $stat = $dev->status; ?> @endif {!! '<span class="text-'.$stat.'"><i class="fa fa-'.$stat.'"></i></span>' !!}
And this is what it's being compiled into.
<?php if($dev->status === "flash"): ?> <?php echo '<?'; ?>php $stat = "danger"?> <?php else: ?> <?php echo '<?'; ?>php $stat = $dev->status; ?> <?php endif; ?> <?php echo '<span class="text-'.$stat.'"><i class="fa fa-'.$stat.'"></i></span>'; ?>
In HAML, you do inline php with the :php filter. Like:
:php
%span.text :php $stat = $dev->status; echo $stat;
Okay I'll give it a go for what I'm trying to accomplish.
Hia, I was trying to do some inline php and for some reason the
<?
is trying to echo out. I'd love to be able to do my inline comparison.This is what is in my haml.blade.php
And this is what it's being compiled into.