如何在 CakePHP Html-> 链接上调用 CSS 类? [英] How to call CSS class on a CakePHP Html->link?

查看:17
本文介绍了如何在 CakePHP Html-> 链接上调用 CSS 类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程和 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆