Changeset 3873
- Timestamp:
- 02/21/08 04:40:00 (17 months ago)
- Files:
-
- 6 modified
-
branches/0.10/manual/docs/en/utilities/pagination/advanced-layouts-with-pager.txt (modified) (4 diffs)
-
branches/0.10/manual/docs/en/utilities/pagination/controlling-range-styles.txt (modified) (1 diff)
-
branches/0.10/manual/docs/en/utilities/pagination/working-with-pager.txt (modified) (2 diffs)
-
trunk/manual/docs/en/utilities/pagination/advanced-layouts-with-pager.txt (modified) (4 diffs)
-
trunk/manual/docs/en/utilities/pagination/controlling-range-styles.txt (modified) (1 diff)
-
trunk/manual/docs/en/utilities/pagination/working-with-pager.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/manual/docs/en/utilities/pagination/advanced-layouts-with-pager.txt
r3872 r3873 26 26 // Creating pager layout 27 27 $pager_layout = new Doctrine_Pager_Layout( 28 new Doctrine_Pager(29 Doctrine_Query::create()30 ->from( 'User u' )31 ->leftJoin( 'u.Group g' )32 ->orderby( 'u.username ASC' ),33 $currentPage,34 $resultsPerPage35 ),36 new Doctrine_Pager_Range_Sliding(array(37 'chunk' => 538 )),39 'http://wwww.domain.com/app/User/list/page,{%page_number}'28 new Doctrine_Pager( 29 Doctrine_Query::create() 30 ->from( 'User u' ) 31 ->leftJoin( 'u.Group g' ) 32 ->orderby( 'u.username ASC' ), 33 $currentPage, 34 $resultsPerPage 35 ), 36 new Doctrine_Pager_Range_Sliding(array( 37 'chunk' => 5 38 )), 39 'http://wwww.domain.com/app/User/list/page,{%page_number}' 40 40 ); 41 41 … … 64 64 // Creating pager layout 65 65 $pager_layout = new Doctrine_Pager_Layout( 66 new Doctrine_Pager(67 Doctrine_Query::create()68 ->from( 'User u' )69 ->leftJoin( 'u.Group g' )70 ->where( 'LOWER(u.username) LIKE LOWER(?)', array( '%'.$_GET['search'].'%' ) )71 ->orderby( 'u.username ASC' ),72 $currentPage,73 $resultsPerPage74 ),75 new Doctrine_Pager_Range_Sliding(array(76 'chunk' => 577 )),78 'http://wwww.domain.com/app/User/list/page,{%page_number}?search={%search}'66 new Doctrine_Pager( 67 Doctrine_Query::create() 68 ->from( 'User u' ) 69 ->leftJoin( 'u.Group g' ) 70 ->where( 'LOWER(u.username) LIKE LOWER(?)', array( '%'.$_GET['search'].'%' ) ) 71 ->orderby( 'u.username ASC' ), 72 $currentPage, 73 $resultsPerPage 74 ), 75 new Doctrine_Pager_Range_Sliding(array( 76 'chunk' => 5 77 )), 78 'http://wwww.domain.com/app/User/list/page,{%page_number}?search={%search}' 79 79 ); 80 80 </code> … … 90 90 // Fetching users 91 91 $users = $pager_layout->execute(); 92 93 foreach ($users as $user) { 94 // ... 95 } 92 96 </code> 93 97 … … 99 103 // Displaying page links 100 104 $pager_layout->display( array( 101 'search' => urlencode($_GET['search'])105 'search' => urlencode($_GET['search']) 102 106 ) ); 103 107 </code> -
branches/0.10/manual/docs/en/utilities/pagination/controlling-range-styles.txt
r3872 r3873 42 42 <code type="php"> 43 43 $pager_range = new Doctrine_Pager_Range_Sliding( 44 array(45 'chunk' => 5 // Chunk length46 ),47 $pager // Doctrine_Pager object we learned how to create in previous topic44 array( 45 'chunk' => 5 // Chunk length 46 ), 47 $pager // Doctrine_Pager object we learned how to create in previous topic 48 48 ); 49 49 </code> -
branches/0.10/manual/docs/en/utilities/pagination/working-with-pager.txt
r3872 r3873 8 8 // Creating pager object 9 9 $pager = new Doctrine_Pager( 10 Doctrine_Query::create()11 ->from( 'User u' )12 ->leftJoin( 'u.Group g' )13 ->orderby( 'u.username ASC' ),14 $currentPage, // Current page of request15 $resultsPerPage // (Optional) Number of results per page. Default is 2510 Doctrine_Query::create() 11 ->from( 'User u' ) 12 ->leftJoin( 'u.Group g' ) 13 ->orderby( 'u.username ASC' ), 14 $currentPage, // Current page of request 15 $resultsPerPage // (Optional) Number of results per page. Default is 25 16 16 ); 17 17 </code> … … 29 29 30 30 <code type="php"> 31 $pager->execute([$args = array() [, $fetchType = Doctrine::FETCH_RECORD]]); 31 $items = $pager->execute([$args = array() [, $fetchType = Doctrine::FETCH_RECORD]]); 32 33 foreach ($items as $item) { 34 // ... 35 } 32 36 </code> 33 37 -
trunk/manual/docs/en/utilities/pagination/advanced-layouts-with-pager.txt
r3872 r3873 26 26 // Creating pager layout 27 27 $pager_layout = new Doctrine_Pager_Layout( 28 new Doctrine_Pager(29 Doctrine_Query::create()30 ->from( 'User u' )31 ->leftJoin( 'u.Group g' )32 ->orderby( 'u.username ASC' ),33 $currentPage,34 $resultsPerPage35 ),36 new Doctrine_Pager_Range_Sliding(array(37 'chunk' => 538 )),39 'http://wwww.domain.com/app/User/list/page,{%page_number}'28 new Doctrine_Pager( 29 Doctrine_Query::create() 30 ->from( 'User u' ) 31 ->leftJoin( 'u.Group g' ) 32 ->orderby( 'u.username ASC' ), 33 $currentPage, 34 $resultsPerPage 35 ), 36 new Doctrine_Pager_Range_Sliding(array( 37 'chunk' => 5 38 )), 39 'http://wwww.domain.com/app/User/list/page,{%page_number}' 40 40 ); 41 41 … … 64 64 // Creating pager layout 65 65 $pager_layout = new Doctrine_Pager_Layout( 66 new Doctrine_Pager(67 Doctrine_Query::create()68 ->from( 'User u' )69 ->leftJoin( 'u.Group g' )70 ->where( 'LOWER(u.username) LIKE LOWER(?)', array( '%'.$_GET['search'].'%' ) )71 ->orderby( 'u.username ASC' ),72 $currentPage,73 $resultsPerPage74 ),75 new Doctrine_Pager_Range_Sliding(array(76 'chunk' => 577 )),78 'http://wwww.domain.com/app/User/list/page,{%page_number}?search={%search}'66 new Doctrine_Pager( 67 Doctrine_Query::create() 68 ->from( 'User u' ) 69 ->leftJoin( 'u.Group g' ) 70 ->where( 'LOWER(u.username) LIKE LOWER(?)', array( '%'.$_GET['search'].'%' ) ) 71 ->orderby( 'u.username ASC' ), 72 $currentPage, 73 $resultsPerPage 74 ), 75 new Doctrine_Pager_Range_Sliding(array( 76 'chunk' => 5 77 )), 78 'http://wwww.domain.com/app/User/list/page,{%page_number}?search={%search}' 79 79 ); 80 80 </code> … … 90 90 // Fetching users 91 91 $users = $pager_layout->execute(); 92 93 foreach ($users as $user) { 94 // ... 95 } 92 96 </code> 93 97 … … 99 103 // Displaying page links 100 104 $pager_layout->display( array( 101 'search' => urlencode($_GET['search'])105 'search' => urlencode($_GET['search']) 102 106 ) ); 103 107 </code> -
trunk/manual/docs/en/utilities/pagination/controlling-range-styles.txt
r3872 r3873 42 42 <code type="php"> 43 43 $pager_range = new Doctrine_Pager_Range_Sliding( 44 array(45 'chunk' => 5 // Chunk length46 ),47 $pager // Doctrine_Pager object we learned how to create in previous topic44 array( 45 'chunk' => 5 // Chunk length 46 ), 47 $pager // Doctrine_Pager object we learned how to create in previous topic 48 48 ); 49 49 </code> -
trunk/manual/docs/en/utilities/pagination/working-with-pager.txt
r3872 r3873 8 8 // Creating pager object 9 9 $pager = new Doctrine_Pager( 10 Doctrine_Query::create()11 ->from( 'User u' )12 ->leftJoin( 'u.Group g' )13 ->orderby( 'u.username ASC' ),14 $currentPage, // Current page of request15 $resultsPerPage // (Optional) Number of results per page. Default is 2510 Doctrine_Query::create() 11 ->from( 'User u' ) 12 ->leftJoin( 'u.Group g' ) 13 ->orderby( 'u.username ASC' ), 14 $currentPage, // Current page of request 15 $resultsPerPage // (Optional) Number of results per page. Default is 25 16 16 ); 17 17 </code> … … 29 29 30 30 <code type="php"> 31 $pager->execute([$args = array() [, $fetchType = Doctrine::FETCH_RECORD]]); 31 $items = $pager->execute([$args = array() [, $fetchType = Doctrine::FETCH_RECORD]]); 32 33 foreach ($items as $item) { 34 // ... 35 } 32 36 </code> 33 37