我有以下几点:
.anchor( , Home ).
我想添加以下CSS类:
class="top_parent"
这是当它呈现在浏览器中,代码将类似于以下几点:
<a href="#" class="top_parent">Home</a>
提前谢谢,非常感谢您的帮助。
- - -
汤姆
我有以下几点:
.anchor( , Home ).
我想添加以下CSS类:
class="top_parent"
这是当它呈现在浏览器中,代码将类似于以下几点:
<a href="#" class="top_parent">Home</a>
提前谢谢,非常感谢您的帮助。
- - -
汤姆
anchor( # , Home , array( class => top_parent ));
Codeignitor函数的定义是这样的:
function anchor($uri = , $title = , $attributes = )
我将试着发送数组类键和值。
这些功能在里面systemhelpers文件夹。
您可以指定一个关联数组的属性你的锚。举个例子:
锚(家里,数组(类= > top_parent));
试试这个:
$myClass = array( class => top_parent );
echo anchor( # , Home , $myClass);
希望你会很清楚的。
这样也可以使用:
<?php echo anchor( # , Home , class="top_parent" ); ?>
如果你想额外的属性例如标题,这是可以做到的是这样的:
<?php echo anchor( # , Home , class="top_parent" title="Home" ); ?>
从Codeigniter年代< a href = " https://ellislab.com/codeigniter/user-guide/helpers/url_helper.html " rel =“nofollow”>手册< / >:
< >强锚()< /强>有三个可选参数:
anchor(uri segments, text, attributes)
简单的例子:
anchor(url,text,array( class => class1 ));
For example if you have a css class called btn
, and a button called submit, to submit (call a submit controller class called sub)
You can do it this way
<?php echo anchor( sub , submit , class="btn" );? >