我有CakePHP 2.5.2。如何修改cake.generic.CSS ONLY将默认按钮更改为图像图标16x16px的动作类表在这里:
<td class="actions">
<?php echo $this->Html->link(__('Payment'), array(
'action' => 'add'); ?>
</td>
如果不修改CSS,我无法做到这一点。我一直在谷歌上搜索,没有比这更好的了:
cake.generic.CSS
#button123 {
background-image: url('../img/image.png');
display: block;
margin: 0 auto;
text-indent: -9999px;
width: 16px;
height: 16px;
}
/视图/协议/index . php:
<?php echo $this->Html->link(__('Task'), array(
'controller' => 'tasks',
'action' => 'add',
array( 'id' => 'button123')
); ?>
任何想法?
很难理解你在问什么,但我猜你在找这样的东西?:
echo $this->Html->link(
$this->Html->image('image.png'),
array('action' => 'add'),
array('escape' => false)
);
我很难想象你会在任何最终产品中使用cake.generic.css,所以-不要使用它,写任何你想要的css。