開発メモ

開発用のメモです。

cakephp view ページング

サンプル

(/2)
始 前 1 2 3 4 5 次 終
 (<select>
        <? for ($i = 1; $i < $this->Paginator->counter("{:pages}"); $i++) { ?>
        <option value="<?= $this->Paginator->url(array('page'=>$i)) ?>" <?= $i == $this->Paginator->counter("{:page}") ? "selected" : "" ?>><?= $i ?></option>
        <? } ?>
    </select>
    <?= $this->Paginator->counter("/{:pages}")?>)<br/>
    <?= $this->Paginator->hasPrev() ? $this->Paginator->first("") : "<span>始</span>" ?>
    <?= $this->Paginator->prev("")?>
    <?= $this->Paginator->numbers(array("separator"=>false))?>
    <?= $this->Paginator->next("")?>
    <?= $this->Paginator->hasNext() ? $this->Paginator->last("") : "<span>終</span>"?>
Twitter: @asahina_alice