我想将缩略图显示为
<div class="col-xs-6 col-md-2">
<a href="/admin/contacts/index" class="thumbnail">
<i class="fa fa-camera-retro fa-5x center-block"></i>
</a>
</div>
我试过但它显示的是html而不是图标
<?php echo $this->Html->link(
'<i class="fa fa-envelope fa-5x center-block"></i>'
),
array('controller'=>'contacts','action'=>'index','admin'=>true),
array('class'=>'thumbnail')) ?>
答案 0 :(得分:2)
使用转义属性
<?php echo $this->Html->link(
'<i class="fa fa-envelope fa-5x center-block"></i>',
array('controller'=>'contacts','action'=>'index','admin'=>true),
array('escape'=>true,'class'=>'thumbnail')) ?>
或Html->tag函数
<?php echo $this->Html->link(
$this->Html->tag('i', '', array('class'=>'fa fa-envelope fa-5x center-block')),
array('controller'=>'contacts','action'=>'index','admin'=>true),
array('escape'=>true,'class'=>'thumbnail')) ?>
(我选择Html->tag
功能)