_total = $total; $this->_totalPage = ceil($total / $pageSize); $this->_currentPage = $currentPage; $this->_pageSize = $pageSize; $this->_pageTemplate = $pageTemplate; if (($currentPage > $this->_totalPage || $currentPage < 1) && $total > 0) { throw new Typecho_Widget_Exception('Page Not Exists', 404); } } /** * 设置页面占位符 * * @access protected * @param string $holder 页面占位符 * @return void */ public function setPageHolder($holder) { $this->_pageHolder = array('{' . $holder . '}', str_replace(array('{', '}'), array('%7B', '%7D'), $holder)); } /** * 设置锚点 * * @access public * @param string $anchor 锚点 * @return void */ public function setAnchor($anchor) { $this->_anchor = '#' . $anchor; } /** * 输出方法 * * @access public * @return void */ public function render() { throw new Typecho_Widget_Exception(get_class($this) . ':' . __METHOD__, 500); } }