protected function createPageLink($url, $page, $currentPage, $idTemplate = null, $classes = array(), $currentPageClass = '') {
        //If this is the current page add the current page class to the classes array
        if ($page == $currentPage) {
            $classes[] = $currentPageClass;
            $disabled = true;
        } else {
            $disabled = false;
        }

        //Create the page url
        $pageUrl = str_replace('!page!', (string)$page, $url);

        //If an id template is present, create the id
        if ($idTemplate) {
            $id = str_replace('!page!', (string)$page, $idTemplate);
        } else {
            $id = null;
        }

        //instance and return the new page link object
        return new PageLink((string)$page, $pageUrl, $id, $classes, $disabled);
    }