public function init()
 {
     $plugin_info = get_file_data(__FILE__, array('version' => 'Version', 'text_domain' => 'Text Domain', 'domain_path' => 'Domain Path'));
     $this->ver = $plugin_info['version'];
     require_once dirname(__FILE__) . '/includes/bootstrap.php';
     $bootstrap_version = self::get_bootstrap_version();
     if ('bootstrap3' === $bootstrap_version) {
         require_once dirname(__FILE__) . '/bootstrap/bootstrap3.php';
         $bootstrap3 = new Bootstrap3($this->ver, plugins_url('', __FILE__));
         $bootstrap3->register();
     } elseif ('bootstrap2' === $bootstrap_version) {
         require_once dirname(__FILE__) . '/bootstrap/bootstrap2.php';
         $bootstrap2 = new Bootstrap2($this->ver, plugins_url('', __FILE__));
         $bootstrap2->register();
     }
 }
Example #2
0
include "Bootstrap3.php";
$pagination = new Pagination();
$pagination->setTotalItems(105)->setProximity(2)->setItemsPerPage(10);
// same as setLimit()
?>
<html>
<head>
	<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />
<style>
body {
	max-width: 580px;
	margin: 20px auto;
}
</style>
</head>
<body>
<h3>Bootstrap3 Pagination</h3>
<?php 
echo Bootstrap3::renderPagination($pagination->toArray());
?>
<h3>Bootstrap3 Pager</h3>
<?php 
echo Bootstrap3::renderPager($pagination->toArray());
?>
<h3>Bootstrap3 Aligned Pager</h3>
<?php 
echo Bootstrap3::renderAlignedPager($pagination->toArray());
?>
</body>
</html>