警报未正确显示

时间:2014-01-16 15:32:38

标签: twitter-bootstrap laravel-4

这是我所谓的newstickers的代码,它基本上是bootstrap中的警报:

    <div class="container">
@if ($newstickers->count())
@foreach($newstickers as $newsticker)

      <div class="
      <?php $options = array(

        1 => "alert",
        2 => "alert alert-success",
        3 => "alert alert-error",
        4 => "alert alert-info"

        );

    echo $options[$newsticker->alerttype];?>"></div><span class="
        <?php $options = array(

        1 => "label",
        2 => "label label-success",
        3 => "label label-warning",
        4 => "label label-important",
        5 => "label label-info",
        6 => "label label-inverse"

        );

    echo $options[$newsticker->labeldatetype];?>">{{{ date("M d, Y - g:i A", strtotime($newsticker->updated_at)) }}}</span>&nbsp;<span class="
        <?php $options = array(

        1 => "label",
        2 => "label label-success",
        3 => "label label-warning",
        4 => "label label-important",
        5 => "label label-info",
        6 => "label label-inverse"

        );

    echo $options[$newsticker->labeltype];?>">{{{ $newsticker->label }}}</span>
        <button type="button" class="close" data-dismiss="alert">&times;</button>

        <td><small>{{{ $newsticker->content }}}</small><div class="pull-right">
    @if(Auth::check())
    @if (Auth::user()->isAdmin())
            <a href="{{ URL::route('admin.newstickers.edit', $newsticker->id) }}"><i class="icon-pencil icon-white"></i></a>&nbsp;<a href="{{ URL::route('admin.newstickers.destroy', $newsticker->id) }}"><i class="icon-remove"></i></a></div></td>
        @endif
        @endif
      </div>

@endforeach

@else

      <div class="alert alert-info"><span class="label label-info">No newstickers</span>

        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <td><small>There are no newstickers. If you wish to create a new one, you should head to our <strong><a href="{{ URL::to('admin/newstickers') }}">newstickers management page!</a></strong></small></td>
      </div>

    </div>

@endif
</div>

它正常运行,但看起来像这样:http://2.imgland.net/--baM.png

之前有用,我正在审查一些旧文件..

1 个答案:

答案 0 :(得分:1)

echo $options[$newsticker->alerttype];?>"></div><span class="

结束</div>。将其移至警报消息的末尾。您还使用<td></td>而没有<table><tr>标记。我认为删除它们会更好。