开发者

CSS classes in HTML links CakePHP 1.3

开发者 https://www.devze.com 2023-03-17 17:05 出处:网络
I have a problem adding CSS classes to my HTML links in CakePHP: I tried the solution as posted in: How to call CSS class on a CakePHP Html->link?

I have a problem adding CSS classes to my HTML links in CakePHP: I tried the solution as posted in: How to call CSS class on a CakePHP Html->link?

If I put the links within the oldschool HTML div class 'my-class' it works.

If I use the code from the example it does not work:

echo $this->Html->link(__('Blogs', true), 开发者_如何学运维array('controller' => 'posts', 'action' => 'index'), array('class' => 'my-class')); 

What can be the reason for this?


By reading your comments, I understand that the link in outputted correctly, the same for the class. Only that the styles associated with that class are not rendered. Am I right?

If so, have you included the CSS file? You should $this->Html->css('style_name');, where style_name is a CSS file located in app/webroot/css/.

0

精彩评论

暂无评论...
验证码 换一张
取 消