php - 如何在 CodeIgniter 分页中将类名设置为 <a> 标签

标签 php codeigniter pagination

我需要将类名设置为 <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/

相关文章:

javascript - Meteor:如何对 simple-todos 演示进行分页?

javascript - 使用 slider 为过滤添加分页,并在加载时显示过滤后的内容

python - Django 。对 Viewset 的 @link 或 @action 方法进行分页

PHP MySQL - 从 select 语句中计算行数

php - Codeigniter 3 - 从外部 Codeigniter 安装访问 session

php - 如何检索并显示二叉树中父节点的所有子节点

php - 在 Codeigniter 中将多行插入数据库

PHP:从 jQuery 解析 JSON

php - API 安全 : how to restrict access by domain?

php - 如何使用Doctrine2统计相关表记录