9.3 Начало работы с Zend_Paginator. Элементы управления постраничной навигации (Pagination Control) и ScrollingStyles | Participants
|
- Statistics
- Participants
- Translate into Russian
- Translation result
- Translated in draft, editing and proof-reading required.
If you do not want to register an account, you can sign in with OpenID.
Getting Started with Zend_Paginator. Pagination Control and ScrollingStyles | 9.3 Начало работы с Zend_Paginator. Элементы управления постраничной навигации (Pagination Control) и ScrollingStyles | |
Rendering the items for a page on the screen has been a good start. In the code snippets in previous section we have also seen the setCurrentPageNumber() method to set the active page number. The next step is to navigate through your pages. To do this, Paginator provides you with two important tools: the ability to render the Paginator with help of a View Partial, and support for so-called ScrollingStyles. | Вывод элементов для страницы на экране имеет хорошее начало. В фрагменте кода в предыдущем разделе мы также видели метод setCurrentPageNumber() для установки номера активной страницы. Следующий шаг это навигация по вашим страницам. Что бы сделать это Paginator предоставляет вам два важных инструмента: возможность выводить Paginator с помощью частичного представления (View Partial), и поддержка так называемого ScrollingStyles. | |
The View Partial is a small view script that renders the Pagination controls, such as buttons to go to the next or previous page. Which pagination controls are rendered depends on the contents of the view partial. Working with the view partial requires that you have set up Zend_View. To get started with the pagination control, create a new view script somewhere in your view scripts path. You can name it anything you want, but we'll call it "controls.phtml" in this text. The reference manual contains various examples of what might go in the view script. Here is one example. | Частичное представление (View Partial) это небольшой скрипт который выводит элементы управления постраничной навигации (Pagination controls), такие как кнопки для перехода к следующей или предыдущей странице. Какие элементы управления выводятся зависит от содержания ...... Работа с частичным представлением требует что бы вы создали Zend_View. Что бы начать работу с постраничной навигацией, создайте новый скрипт вида (view script) где-то в ваших скриптах вида. Вы можете назвать его как угодно, но здесь мы его назовем "controls.phtml". Справочное руководство содержит множество примеров того, что может находиться в скрипте вида. Вот один из примеров. | |
01. <?php if ($this->pageCount): ?> | ||
02. <!-- First page link --> | ||
03. <?php if (isset($this->previous)): ?> | ||
04. <a href="<?php echo $this->url(array('page' => $this->first)); ?>"> | 04. <a href="<?php echo $this->url(array('page' => $this->first)); ?>"> | |
05. First | ||
06. </a> | | ||
07. <?php else: ?> | ||
08. <span class="disabled">First</span> | | ||
09. <?php endif; ?> | ||
10. | ||
11. <!-- Previous page link --> | ||
12. <?php if (isset($this->previous)): ?> | ||
13. <a href="<?php echo $this->url(array('page' => $this->previous)); ?>"> | 13. <a href="<?php echo $this->url(array('page' => $this->previous)); ?>"> | |
14. < Previous | ||
15. </a> | | ||
16. <?php else: ?> | ||
17. <span class="disabled">< Previous</span> | | ||
18. <?php endif; ?> | ||
19. | ||
20. <!-- Next page link --> | ||
21. <?php if (isset($this->next)): ?> | ||
22. <a href="<?php echo $this->url(array('page' => $this->next)); ?>"> | 22. <a href="<?php echo $this->url(array('page' => $this->next)); ?>"> | |
23. Next > | ||
24. </a> | | ||
25. <?php else: ?> | ||
26. <span class="disabled">Next ></span> | | 26. <span class="disabled">Следующая ></span> | | |
27. <?php endif; ?> | ||
28. | ||
29. <!-- Last page link --> | ||
30. <?php if (isset($this->next)): ?> | ||
31. <a href="<?php echo $this->url(array('page' => $this->last)); ?>"> | 31. <a href="<?php echo $this->url(array('page' => $this->last)); ?>"> |
