![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 422 Pomógł: 0 Dołączył: 14.12.2005 Skąd: Wałbrzych Ostrzeżenie: (0%) ![]() ![]() |
Czy istnieje jakaś klasa pagera?
Muszę coś na szybko trzasnąć i potrzebowałbym czegoś porządnego i dobrego. W googlach znalazłem jeden, ale jakiś świetny to on nie był. pozdrawiam Ten post edytował Balon 22.04.2008, 19:18:33 -------------------- Postura wielka i morda wredna, jestem Balon, kozak z osiedla !
bzdury.pl - Królestwo rozrywki |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 2 291 Pomógł: 156 Dołączył: 23.09.2007 Skąd: ITALY-MILAN Ostrzeżenie: (10%) ![]() ![]() |
Pager Nospor'a
http://forumphp.nq.pl/index.php?showtopic=...t=0&start=0 Ten post edytował marcio 22.04.2008, 21:07:35 -------------------- Zainteresowania: XML | PHP | MY(SQL)| C# for .NET | PYTHON
http://code.google.com/p/form-builider/ Moj blog |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 131 Pomógł: 0 Dołączył: 19.08.2003 Skąd: Bydgoszcz Ostrzeżenie: (0%) ![]() ![]() |
view/helpers/Pagination.php
CODE <?php class My_View_Helper_Pagination { private $intRows = 0; private $intLimit = 0; private $intPage = 0; private $blnFailure = false; private $strController; private $strAction; private $_view; public function setView( $view ) { $this -> _view = $view; } public function pagination() { return $this; } public function SetOptions( $intPage, $intLimit, $intRows, $strController, $strAction ) { if( isset( $intPage ) && isset( $intLimit ) && isset( $intRows ) ) { $this -> intRows = $intRows; $this -> intLimit = $intLimit; $this -> intPage = $intPage; $this -> strController = $strController; $this -> strAction = $strAction; } else { $this -> blnFailure = true; } } public function Render() { if( $this -> blnFailure === true ) { return 'Pagination: Upewnij sie, ze zdefiniowales wszystkie opcje w Twojej akcji kontrolera'; } else { $this -> _view -> pag_intPages = ceil( $this -> intRows / $this -> intLimit ); $this -> _view -> pag_intPage = $this -> intPage; $this -> _view -> pag_strContoller = $this -> strController; $this -> _view -> pag_strAction = $this -> strAction; return $this -> _view -> render( 'pagination.phtml' ); } } } view/scripts/pagination.phtml:
plik kontrolera: CODE <?php class TwojController extends Front_Controller_Action { // ... function indexAction() { $intPage = $this -> _request -> getParam( 'p' ); // numer strony znajduje sie w parametrze "p" $intPage = ( !empty( $intPage ) ) ? $intPage : 1; $intLimit = ... // tutaj wyciagnij sobie limit rekordow na stronie z configa czy cos $this -> view -> pag_intRows = (int)$this -> CountRows(); // zliczenie wszystkich rekordów $this -> view -> pag_intLimit = $intLimit; $this -> view -> pag_intPage = $intPage; $this -> view -> pag_strController = 'twoj'; //nazwa kontrolera $this -> view -> pag_strAction = 'index'; //nazwa akcji } index.phtml: w miejscu gdzie chcesz wyswietlic stronnicowanie CODE <?php $this -> pagination() -> SetOptions( $this -> pag_intPage, $this -> pag_intLimit, $this -> pag_intRows, $this -> pag_strController, $this -> pag_strAction ); print( $this -> pagination() -> Render() ); ?> -------------------- |
|
|
![]()
Post
#4
|
|
![]() Grupa: Zarejestrowani Postów: 422 Pomógł: 0 Dołączył: 14.12.2005 Skąd: Wałbrzych Ostrzeżenie: (0%) ![]() ![]() |
Z pierwszym pokombinuje. A ten drugi coś nie chce śmigać
![]() Znalazłem rozwiązanie. Napisałem własny pager ![]() Ten post edytował Balon 23.04.2008, 20:52:35 -------------------- Postura wielka i morda wredna, jestem Balon, kozak z osiedla !
bzdury.pl - Królestwo rozrywki |
|
|
![]() ![]() |
![]() |
Aktualny czas: 21.08.2025 - 03:43 |