Mayur Patil
Mayur Patil

Reputation: 46

How can I disable href of anchor in codeigniter?

I am using multiple pagination in single web page. here I am using jquery-ajax for pagination. but even if I am keeping "base_url" option as blank I am unable to hold redirection of anchor.

$config['base_url'] = '';
$config['per_page'] = 10;
$config['num_links'] = 2;
$config['anchor_class'] = "onclick='return show_new_page();'";

Upvotes: 0

Views: 938

Answers (1)

tomJO
tomJO

Reputation: 371

In your case I would create a custom library (read about it here)

Go the /system/libraries and copy pagination.php file from here to the /application/libraries

Rename it to something you like. Open it, find create_links function, find anchors, edit it the way you want. Load your custom pagination into your controller's function.

Also, don't forget to change the class name of the library to the name of the file.

Upvotes: 1

Related Questions