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">&gt;</a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last &rsaquo;</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.










share|improve this question
























  • 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















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">&gt;</a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last &rsaquo;</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.










share|improve this question
























  • 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













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">&gt;</a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last &rsaquo;</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.










share|improve this question















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">&gt;</a></a><li><a href="http://24.179.134.185/index.php/panel/home/15" data-ci-pagination-page="4">Last &rsaquo;</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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Lugert, Oklahoma