Esempio n. 1
0
 public function jumpSelect()
 {
     $totalPage = $this->getTotalPage();
     $url = Zee::getCurrentUrl(array($this->varName => ""));
     if (strstr($url, '?')) {
         $separator = '&';
     } else {
         $separator = '?';
     }
     $jumpString = "转到";
     $jumpString .= "<select id=\"jump_select\" size=\"1\" onChange=\"window.location='{$url}{$separator}{$this->varName}='+this.value\">";
     for ($i = 1; $i <= $totalPage; $i++) {
         /**选中当前页*/
         if ($this->pageNum == $i) {
             $extra = "selected";
         } else {
             $extra = "";
         }
         $jumpString .= "<option value='" . $i . "' " . $extra . ">" . $i . "</option>";
     }
     if (!$totalPage) {
         $jumpString .= "<option selected>  </option>";
     }
     $jumpString .= "</select> 页";
     return $jumpString;
 }