Example #1
0
 /**
  * 显示方法
  * @author jry <*****@*****.**>
  */
 protected final function display($file = '')
 {
     if ($file == '') {
         $file = CONTROLLER_NAME;
     }
     if (MODULE_MARK === 'Home') {
         if (C('CURRENT_THEME')) {
             $template = './Theme/' . C('CURRENT_THEME') . '/Home/Addons/' . $this->getName() . '/' . $file . '.html';
             if (is_file($template)) {
                 $file = $template;
             }
             if (\Common\Util\Device::isWap()) {
                 $wap_template = './Theme/' . C('CURRENT_THEME') . '/Home/Wap/Addons/' . $this->getName() . '/' . $file . '.html';
                 if (is_file($wap_template)) {
                     $file = $wap_template;
                 }
             }
         } else {
             if (\Common\Util\Device::isWap()) {
                 $wap_template = './Addons/' . $this->getName() . '/Wap/' . $file . '.html';
                 if (is_file($wap_template)) {
                     $file = $wap_template;
                 }
             }
         }
     }
     echo $this->fetch($file);
 }
Example #2
0
 /**
  * 架构函数
  * @param array $totalRows  总的记录数
  * @param array $listRows  每页显示记录数
  * @param array $parameter  分页跳转的参数
  */
 public function __construct($totalRows, $listRows = 20, $parameter = array())
 {
     C('VAR_PAGE') && ($this->p = C('VAR_PAGE'));
     //设置分页参数名称
     /* 基础设置 */
     $this->totalRows = $totalRows;
     //设置总记录数
     $this->listRows = $listRows;
     //设置每页显示行数
     $this->parameter = empty($parameter) ? $_GET : $parameter;
     $this->nowPage = empty($_GET[$this->p]) ? 1 : intval($_GET[$this->p]);
     $this->nowPage = $this->nowPage > 0 ? $this->nowPage : 1;
     $this->firstRow = $this->listRows * ($this->nowPage - 1);
     if (\Common\Util\Device::isWap()) {
         $this->rollPage = 3;
         $this->config['theme'] = '%UP_PAGE%%LINK_PAGE%%DOWN_PAGE%';
     }
 }