如何在CakePHP Html->链接上调用CSS类? [英] How to call CSS class on a CakePHP Html->link?
本文介绍了如何在CakePHP Html->链接上调用CSS类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是一个完整的noob编程和CakePHP在一起,所以请耐心等待。我应该在这个Html->链接上调用CSS:
I am a complete noob to programming and CakePHP all together, so please be patient. How am I supposed to call the CSS on this Html->link:
<?php echo $this->Html->link(__('Blogs', true), array('controller' => 'posts', 'action' => 'index') ); ?>
请帮助。
推荐答案
不知道你的意思是调用css,我想你想添加一个类到这个链接?在这种情况下,你可以只是添加另一个数组作为参数,它会将key =?值转换为HTML属性。 EG:
Not sure what you mean by "call the css", I think you want to add a class to this link? IF that's the case you can just add another array as an argument and it will turn key =? value into HTML attributes. EG:
echo $this->Html->link(__('Blogs', true), array('controller' => 'posts', 'action' => 'index'), array('class' => 'my-class'));
这一切都在 CakePHP文档。
这篇关于如何在CakePHP Html->链接上调用CSS类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文