In the ci paging class, how can I change the displayed number (previous page, next page, homepage, and last page) into an image display?

Source: Internet
Author: User
Tags codeigniter
In the ci paging class, how can I change the displayed number (previous page, next page, homepage, and last page) into an image display? Ci paging

In the ci paging class, how can I change the displayed number (previous page, next page, homepage, and last page) into an image display?
For example


Reply to discussion (solution)

Find the text and replace it with the img Mark

Find the text and replace it with the img Mark

For more information, see !!!
 '; Var $ cur_tag_close =''; Var $ next_tag_open = ''; var $ next_tag_close =''; var $ prev_tag_open = ''; var $ prev_tag_close =''; var $ num_tag_open = ''; var $ num_tag_close = ''; var $ page_query_string = FALSE; var $ query_string_segment = 'per _ page'; var $ display_pages = TRUE; var $ anchor_class = ''; /*** Constructor *** @ accesspublic * @ paramarrayinitialization parameters */public function _ construct ($ params = array () {if (count ($ param S)> 0) {$ this-> initialize ($ params);} if ($ this-> anchor_class! = '') {$ This-> anchor_class = 'class = "'. $ this-> anchor_class. '"';} log_message ('debug'," Pagination Class Initialized ");} // Configure/*** Initialize Preferences ** @ accesspublic * @ paramarrayinitialization parameters * @ returnvoid */function initialize ($ params = array ()) {if (count ($ params)> 0) {foreach ($ params as $ key => $ val) {if (isset ($ th Is-> $ key) {$ this-> $ key = $ val ;}}}} // ----------------------------------------------------------------------/*** Generate the pagination links *** @ accesspublic * @ returnstring */function create_links () {// If our item count or per-page total is zero there is no need to continue. if ($ this-> total_rows = 0 OR $ this-> per_page = 0) {return '';} // Calculate the total number of pages $ num_pages = ceil ($ thi S-> total_rows/$ this-> per_page); // Is there only one page? Hm... nothing more to do here then. if ($ num_pages = 1) {return '';} // Set the base page index for starting page numberif ($ this-> use_page_numbers) {$ base_page = 1 ;} else {$ base_page = 0;} // Determine the current page number. $ CI = & get_instance (); if ($ CI-> config-> item ('enable _ query_strings ') === true or $ this-> page_query_string = TRUE) {if ($ CI-> input-> get ($ this-> query_string_segment )! = $ Base_page) {$ this-> cur_page = $ CI-> input-> get ($ this-> query_string_segment); // Prep the current page-no funny business! $ This-> cur_page = (int) $ this-> cur_page;} else {if ($ CI-> uri-> segment ($ this-> uri_segment )! = $ Base_page) {$ this-> cur_page = $ CI-> uri-> segment ($ this-> uri_segment); // Prep the current page-no funny business! $ This-> cur_page = (int) $ this-> cur_page ;}} // Set current page to 1 if using page numbers instead of offsetif ($ this-> use_page_numbers AND $ this-> cur_page = 0) {$ this-> cur_page = $ base_page;} $ this-> num_links = (int) $ this-> num_links; if ($ this-> num_links <1) {show_error ('your number of links must be a positive number. ');} if (! Is_numeric ($ this-> cur_page) {$ this-> cur_page = $ base_page;} // Is the page number beyond the result range? // If so we show the last pageif ($ this-> use_page_numbers) {if ($ this-> cur_page> $ num_pages) {$ this-> cur_page = $ num_pages ;}} else {if ($ this-> cur_page> $ this-> total_rows) {$ this-> cur_page = ($ num_pages-1) * $ this-> per_page ;}} $ uri_page_number = $ this-> cur_page; if (! $ This-> use_page_numbers) {$ this-> cur_page = floor ($ this-> cur_page/$ this-> per_page) + 1 );} // Calculate the start and end numbers. these determine // which number to start and end the digit links with $ start = ($ this-> cur_page-$ this-> num_links)> 0 )? $ This-> cur_page-($ this-> num_links-1): 1; $ end = ($ this-> cur_page + $ this-> num_links) <$ num_pages )? $ This-> cur_page + $ this-> num_links: $ num_pages; // Is pagination being used over GET or POST? If get, add a per_page query // string. if post, add a trailing slash to the base URL if neededif ($ CI-> config-> item ('enable _ query_strings ') === true or $ this-> page_query_string === TRUE) {$ this-> base_url = rtrim ($ this-> base_url ). '&'. $ this-> query_string_segment. '=';} else {$ this-> base_url = rtrim ($ this-> base_url ,'/'). '/';} // And here we go... $ output = ''; // Render the" First "linkif ($ this-> first_li Nk! = False and $ this-> cur_page> ($ this-> num_links + 1) {$ first_url = ($ this-> first_url = '')? $ This-> base_url: $ this-> first_url; $ output. = $ this-> first_tag_open. 'anchor _ class. 'href = "'. $ first_url. '"> '. $ this-> first_link. ''. $ this-> first_tag_close;} // Render the "previous" linkif ($ this-> prev_link! = False and $ this-> cur_page! = 1) {if ($ this-> use_page_numbers) {$ I = $ uri_page_number-1;} else {$ I = $ uri_page_number-$ this-> per_page ;} if ($ I = 0 & $ this-> first_url! = '') {$ Output. = $ this-> prev_tag_open. 'anchor _ class. 'href = "'. $ this-> first_url. '"> '. $ this-> prev_link. ''. $ this-> prev_tag_close;} else {$ I = ($ I = 0 )? '': $ This-> prefix. $ I. $ this-> suffix; $ output. = $ this-> prev_tag_open. 'anchor _ class. 'href = "'. $ this-> base_url. $ I. '"> '. $ this-> prev_link. ''. $ this-> prev_tag_close; }}// Render the pagesif ($ this-> display_pages! = FALSE) {// Write the digit linksfor ($ loop = $ start-1; $ loop <= $ end; $ loop ++) {if ($ this-> use_page_numbers) {$ I = $ loop;} else {$ I = ($ loop * $ this-> per_page)-$ this-> per_page ;} if ($ I >=$ base_page) {if ($ this-> cur_page ==$ loop) {$ output. = $ this-> cur_tag_open. $ loop. $ this-> cur_tag_close; // Current page} else {$ n = ($ I = $ base_page )? '': $ I; if ($ n ='' & $ this-> first_url! = '') {$ Output. = $ this-> num_tag_open. 'anchor _ class. 'href = "'. $ this-> first_url. '"> '. $ loop. ''. $ this-> num_tag_close;} else {$ n = ($ n = '')? '': $ This-> prefix. $ n. $ this-> suffix; $ output. = $ this-> num_tag_open. 'anchor _ class. 'href = "'. $ this-> base_url. $ n. '"> '. $ loop. ''. $ this-> num_tag_close ;}}}// Render the "next" linkif ($ this-> next_link! = False and $ this-> cur_page <$ num_pages) {if ($ this-> use_page_numbers) {$ I = $ this-> cur_page + 1 ;} else {$ I = ($ this-> cur_page * $ this-> per_page);} $ output. = $ this-> next_tag_open. 'anchor _ class. 'href = "'. $ this-> base_url. $ this-> prefix. $ I. $ this-> suffix. '"> '. $ this-> next_link. ''. $ this-> next_tag_close;} // Render the "Last" linkif ($ this-> last_link! = False and ($ this-> cur_page + $ this-> num_links) <$ num_pages) {if ($ this-> use_page_numbers) {$ I = $ num_pages ;} else {$ I = ($ num_pages * $ this-> per_page)-$ this-> per_page);} $ output. = $ this-> last_tag_open. 'anchor _ class. 'href = "'. $ this-> base_url. $ this-> prefix. $ I. $ this-> suffix. '"> '. $ this-> last_link. ''. $ this-> last_tag_close;} // Kill double slashes. note: Sometimes we can end up with a double slash // in the penultimate link so we'll kill all double slashes. $ output = preg_replace ("# ([^:]) // + #", "\ 1/", $ output ); // Add the wrapper HTML if exists $ output = $ this-> full_tag_open. $ output. $ this-> full_tag_close; return $ output ;}// END Pagination Class/* End of file Pagination. php * // * Location :. /system/libraries/Pagination. php */

Where did you find "top page"? changed it.
Other similarities

After $ output is replaced, return

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.