-
Hiển thị 1-10 của 10 tin nhắn. Mạch tin nhắnĐã gửi cách đây 5461 ngàyĐã gửi cách đây 5461 ngàyĐã gửi cách đây 5461 ngày
3. Refactoring a. Model The question/list action executes code that is closely related to the model, that's why we will move this code to the model. Replace the question/list action by:
Đã gửi cách đây 5461 ngàye.Add the routing rule for the subsequent pages open the apps/frontend/config/routing.yml file and add at the top: popular_questions:
url: /index/:page param: { module: question, action: list }
add another routing rule for the login page: login:
url: /login param: { module: user, action: login }
Đã gửi cách đây 5461 ngàyThis code takes advantage of the numerous methods of the sfPropelPager object, among which ->haveToPaginate(), which returns true only if the number of results to the request exceeds the page size; ->getPreviousPage(), ->getNextPage() and ->getLastPage(), which have obvious meanings; ->getLinks(), which provides an array of page numbers; and ->getCurrentMaxLink(), which returns the last page number.
Đã gửi cách đây 5461 ngàyd.Add page navigation There is one more thing to add to this template: The page navigation. append at the end of the template:
Đã gửi cách đây 5461 ngàyd. Add page navigation There is one more thing to add to this template: The page navigation. append at the end of the template:
<?php if ($question_pager->haveToPaginate()): ?>
<?php echo link_to('Đã gửi cách đây 5461 ngàyc. Modify the listSuccess.php template In the listSuccess.php template, just replace the line <?php foreach($questions as $question): ?> by <?php foreach($question_pager->getResults() as $question): ?>
Đã gửi cách đây 5461 ngàyb.Create the loginSuccess.php template In the askeet/apps/frontend/modules/user/templates/ directory, create the following loginSuccess.php template:
These symfony functions help to automate the writing of form tags. The form_tag() helper opens a form with a default POST behaviour, and points to the action given as argument. The input_tag() helper produces an <input> tag (that's a surprise) by automatically adding an id attribute based on the name given as first argument; the default value is taken from the second argument. Read more in the: http://www.symfony-project.org/book/1_0/10-Forms
tác giả
Tìm thêm với Google.com :
NHÀ TÀI TRỢ