2014-01-16 113 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>標籤。我認爲最好刪除它們。