Last active
November 12, 2018 18:24
-
-
Save 18thAvenue/d2d81ba794068a26ace0e602ea691543 to your computer and use it in GitHub Desktop.
CFwheels Bootstrap 4 Pagination Links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Modified Chris Peters pagination function in https://github.com/liquifusion/bootstrap-cfwheels/blob/master/Bootstrap.cfc ---> | |
<cffunction name="b4PaginationLinks" returntype="string" hint="Bootstrap 4 markup version of the Wheels `paginationLinks` view helper."> | |
<cfscript> | |
var loc = {}; | |
loc.paginationArgs = Duplicate(arguments); | |
loc.paginationArgs.prepend = '<ul class="pagination">'; | |
loc.paginationArgs.append = '</ul>'; | |
loc.paginationArgs.prependToPage='<li class="page-item">' | |
loc.paginationArgs.appendToPage = '</li>'; | |
loc.paginationArgs.class="page-link"; | |
loc.paginationArgs.classForCurrent = "page-link active"; | |
loc.paginationArgs.linkToCurrentPage = false; | |
loc.paginationArgs.anchorDivider = ""; | |
loc.paginationArgs.linkToCurrentPage = true; | |
loc.paginationArgs.encode="false"; | |
loc.paginationLinks = paginationLinks(argumentCollection=loc.paginationArgs); | |
loc.paginationLinks = replaceNoCase(loc.paginationLinks, '<li class="page-item"><a class="page-link active"', | |
'<li class="page-item active"><a class="page-link"', "all"); | |
</cfscript> | |
<cfreturn loc.paginationLinks> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment