我需要将类名设置为 <a>
CodeIgniter 分页中的标记。
CodeIgniter 的 $this->pagination->create_links();
函数创建这样的链接:
<a href="http://example.com/pages/3">3</a>
但是,我需要这样的链接:
<a href="http://example.com/pages/3" class="number">3</a>
我该如何解决这个问题?
最佳答案
这是下面的代码,您可以使用它在 Code Ignitor 的分页 anchor 标记内添加类
$config['attributes'] = array('class' => 'myclass');
关于php - 如何在 CodeIgniter 分页中将类名设置为 <a> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8707283/