Skip to content

Instantly share code, notes, and snippets.

@18thAvenue
Last active November 12, 2018 18:24
Show Gist options
  • Save 18thAvenue/d2d81ba794068a26ace0e602ea691543 to your computer and use it in GitHub Desktop.
Save 18thAvenue/d2d81ba794068a26ace0e602ea691543 to your computer and use it in GitHub Desktop.
CFwheels Bootstrap 4 Pagination Links
<!--- 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