Duplicate with pagination in CodeIgniter 3
up vote
-1
down vote
favorite
panel.php (controller)
// Pagination
$config['base_url'] = base_url() . 'index.php/panel/home/';
$config['per_page'] = 5;
$page = $this->uri->segment(3,0);
$data['ticket'] = $this->ticket_system->get_tickets($config['per_page'], $page);
$config['total_rows'] = $this->ticket_system->getTotalTickets();
// Pagination Style
$config['first_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a></li>';
$config['lag_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a><li>';
$config['prev_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['prev_tag_close'] = '</a><li>';
$config['next_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['next_tag_close'] = '</a><li>';
$config['num_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['num_tag_close'] = '</a><li>';
$config['cur_tag_open'] = '<li class="active"><a href="#">';
$config['cur_tag_close'] = '</a><li>';
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$this->load->view('template/header', $data);
$this->load->view('panel/home', $data);
$this->load->view('template/footer');
home.php (view)
<div class="row">
<?php foreach($ticket as $ticket) : ?>
<div class="col-md-12 ticket">
<?php echo $ticket['ticketId'] ?>
<br>
<?php echo $ticket['createTime'] ?>
<br>
<?php echo $ticket['name'] ?>
<br>
<?php echo $ticket['message'] ?>
<br>
<?php echo $ticket['assignedTo'] ?>
<br>
<?php echo $ticket['comment'] ?>
<br>
<?php echo $ticket['response'] ?>
<br>
</div>
<?php endforeach; ?>
<ul class="pagination">
<?php echo $pagination; ?>
</ul>
</div>
Firefox inspect
<ul class="pagination">
<li class="active"><a href="#">1</a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2">2</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/10" data-ci-pagination-page="3">3</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2" rel="next">></a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last ›</a>
</ul>
It keeps duplicating the li and I can't seem to get it to work, I've tried many things and I can't figure it out. Any input would help.
php pagination bootstrap-4 codeigniter-3
add a comment |
up vote
-1
down vote
favorite
panel.php (controller)
// Pagination
$config['base_url'] = base_url() . 'index.php/panel/home/';
$config['per_page'] = 5;
$page = $this->uri->segment(3,0);
$data['ticket'] = $this->ticket_system->get_tickets($config['per_page'], $page);
$config['total_rows'] = $this->ticket_system->getTotalTickets();
// Pagination Style
$config['first_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a></li>';
$config['lag_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a><li>';
$config['prev_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['prev_tag_close'] = '</a><li>';
$config['next_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['next_tag_close'] = '</a><li>';
$config['num_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['num_tag_close'] = '</a><li>';
$config['cur_tag_open'] = '<li class="active"><a href="#">';
$config['cur_tag_close'] = '</a><li>';
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$this->load->view('template/header', $data);
$this->load->view('panel/home', $data);
$this->load->view('template/footer');
home.php (view)
<div class="row">
<?php foreach($ticket as $ticket) : ?>
<div class="col-md-12 ticket">
<?php echo $ticket['ticketId'] ?>
<br>
<?php echo $ticket['createTime'] ?>
<br>
<?php echo $ticket['name'] ?>
<br>
<?php echo $ticket['message'] ?>
<br>
<?php echo $ticket['assignedTo'] ?>
<br>
<?php echo $ticket['comment'] ?>
<br>
<?php echo $ticket['response'] ?>
<br>
</div>
<?php endforeach; ?>
<ul class="pagination">
<?php echo $pagination; ?>
</ul>
</div>
Firefox inspect
<ul class="pagination">
<li class="active"><a href="#">1</a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2">2</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/10" data-ci-pagination-page="3">3</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2" rel="next">></a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last ›</a>
</ul>
It keeps duplicating the li and I can't seem to get it to work, I've tried many things and I can't figure it out. Any input would help.
php pagination bootstrap-4 codeigniter-3
I've deleted the closing configs which seemed to fix the duplicate, but it's still not showing up correctly.
– Cameron
Nov 11 at 0:48
I've almost fixed this, but it's still duplicating <a>, pagination seems to be generating <a href="#"> and the <a class="page-link"> is being generated before it via the config.
– Cameron
Nov 11 at 1:48
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
panel.php (controller)
// Pagination
$config['base_url'] = base_url() . 'index.php/panel/home/';
$config['per_page'] = 5;
$page = $this->uri->segment(3,0);
$data['ticket'] = $this->ticket_system->get_tickets($config['per_page'], $page);
$config['total_rows'] = $this->ticket_system->getTotalTickets();
// Pagination Style
$config['first_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a></li>';
$config['lag_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a><li>';
$config['prev_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['prev_tag_close'] = '</a><li>';
$config['next_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['next_tag_close'] = '</a><li>';
$config['num_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['num_tag_close'] = '</a><li>';
$config['cur_tag_open'] = '<li class="active"><a href="#">';
$config['cur_tag_close'] = '</a><li>';
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$this->load->view('template/header', $data);
$this->load->view('panel/home', $data);
$this->load->view('template/footer');
home.php (view)
<div class="row">
<?php foreach($ticket as $ticket) : ?>
<div class="col-md-12 ticket">
<?php echo $ticket['ticketId'] ?>
<br>
<?php echo $ticket['createTime'] ?>
<br>
<?php echo $ticket['name'] ?>
<br>
<?php echo $ticket['message'] ?>
<br>
<?php echo $ticket['assignedTo'] ?>
<br>
<?php echo $ticket['comment'] ?>
<br>
<?php echo $ticket['response'] ?>
<br>
</div>
<?php endforeach; ?>
<ul class="pagination">
<?php echo $pagination; ?>
</ul>
</div>
Firefox inspect
<ul class="pagination">
<li class="active"><a href="#">1</a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2">2</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/10" data-ci-pagination-page="3">3</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2" rel="next">></a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last ›</a>
</ul>
It keeps duplicating the li and I can't seem to get it to work, I've tried many things and I can't figure it out. Any input would help.
php pagination bootstrap-4 codeigniter-3
panel.php (controller)
// Pagination
$config['base_url'] = base_url() . 'index.php/panel/home/';
$config['per_page'] = 5;
$page = $this->uri->segment(3,0);
$data['ticket'] = $this->ticket_system->get_tickets($config['per_page'], $page);
$config['total_rows'] = $this->ticket_system->getTotalTickets();
// Pagination Style
$config['first_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a></li>';
$config['lag_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['first_tag_close'] = '</a><li>';
$config['prev_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['prev_tag_close'] = '</a><li>';
$config['next_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['next_tag_close'] = '</a><li>';
$config['num_tag_open'] = '<li class="page-item"><a class="page-link">';
$config['num_tag_close'] = '</a><li>';
$config['cur_tag_open'] = '<li class="active"><a href="#">';
$config['cur_tag_close'] = '</a><li>';
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$this->load->view('template/header', $data);
$this->load->view('panel/home', $data);
$this->load->view('template/footer');
home.php (view)
<div class="row">
<?php foreach($ticket as $ticket) : ?>
<div class="col-md-12 ticket">
<?php echo $ticket['ticketId'] ?>
<br>
<?php echo $ticket['createTime'] ?>
<br>
<?php echo $ticket['name'] ?>
<br>
<?php echo $ticket['message'] ?>
<br>
<?php echo $ticket['assignedTo'] ?>
<br>
<?php echo $ticket['comment'] ?>
<br>
<?php echo $ticket['response'] ?>
<br>
</div>
<?php endforeach; ?>
<ul class="pagination">
<?php echo $pagination; ?>
</ul>
</div>
Firefox inspect
<ul class="pagination">
<li class="active"><a href="#">1</a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2">2</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/10" data-ci-pagination-page="3">3</a></a>
<li><li class="page-item"><a class="page-link"><a href="http://24.179.134.185/index.php/panel/home/5" data-ci-pagination-page="2" rel="next">></a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last ›</a>
</ul>
It keeps duplicating the li and I can't seem to get it to work, I've tried many things and I can't figure it out. Any input would help.
php pagination bootstrap-4 codeigniter-3
php pagination bootstrap-4 codeigniter-3
edited Nov 11 at 0:45
FrankerZ
15.5k72859
15.5k72859
asked Nov 11 at 0:41
Cameron
41
41
I've deleted the closing configs which seemed to fix the duplicate, but it's still not showing up correctly.
– Cameron
Nov 11 at 0:48
I've almost fixed this, but it's still duplicating <a>, pagination seems to be generating <a href="#"> and the <a class="page-link"> is being generated before it via the config.
– Cameron
Nov 11 at 1:48
add a comment |
I've deleted the closing configs which seemed to fix the duplicate, but it's still not showing up correctly.
– Cameron
Nov 11 at 0:48
I've almost fixed this, but it's still duplicating <a>, pagination seems to be generating <a href="#"> and the <a class="page-link"> is being generated before it via the config.
– Cameron
Nov 11 at 1:48
I've deleted the closing configs which seemed to fix the duplicate, but it's still not showing up correctly.
– Cameron
Nov 11 at 0:48
I've deleted the closing configs which seemed to fix the duplicate, but it's still not showing up correctly.
– Cameron
Nov 11 at 0:48
I've almost fixed this, but it's still duplicating <a>, pagination seems to be generating <a href="#"> and the <a class="page-link"> is being generated before it via the config.
– Cameron
Nov 11 at 1:48
I've almost fixed this, but it's still duplicating <a>, pagination seems to be generating <a href="#"> and the <a class="page-link"> is being generated before it via the config.
– Cameron
Nov 11 at 1:48
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244823%2fduplicate-li-with-pagination-in-codeigniter-3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I've deleted the closing configs which seemed to fix the duplicate, but it's still not showing up correctly.
– Cameron
Nov 11 at 0:48
I've almost fixed this, but it's still duplicating <a>, pagination seems to be generating <a href="#"> and the <a class="page-link"> is being generated before it via the config.
– Cameron
Nov 11 at 1:48