2014-01-16 91 views
0

这是我所谓的newstickers代码,它基本上提醒自举:警报无法正确显示

<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

它工作之前,我m审查我的一些旧文件..

+0

你可以把生成的html放在这里吗? – JackPoint

+0

@杰克点确定,在这里http://pastebin.com/SLbHxDen – dinomuharemagic

回答

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

有关闭</div>。将其移动到警报消息的末尾。您也在使用<td></td>而没有<table><tr>标签。我认为最好删除它们。