public static function createPages($totalCount, $currPage, $perPage, $baseUrl) { ob_start(); $numPages = (int) ($totalCount / $perPage) + 1; echo ' | '; for ($i = 1; $i <= $numPages; $i++) { if ($i == $currPage) { echo $i; } else { ?> <a href="<?php echo Mvc::paramReplace('&pg', $i, $baseUrl); ?> "><?php echo $i; ?> </a><?php } echo ' | '; } return ob_get_clean(); }