TAILIEUCHUNG - Beginning Zend Framework phần 4

Thiết lập các biến xemThiết lập các tổng số của các nghệ sĩ trong mảngThể hiện việc sử dụng của một mảng quan trọng có giá trị chuyển nhượngXác định thời gian bao lâu một hình ảnh CAPTCHA phải cư trú trong các máy chủ (chấp nhận thời gian trong vài giây). | CHAPTER 4 VIEWS FORMS FILTERS AND VALIDATORS Get the user s Id Get the user s artist with rating. artists array array name Thievery Corporation rating 5 array name The Eagles rating 5 array name Elton John rating 4 Create the class artistObj new StdClass artistObj- artists artists Set the view variables this- view- assign array artistObj Set the total number of artists in the array. Demonstrates the use of a key-value array assignment. totalNumberOfArtists array totalArtist count artists Set the view variables this- view- assign array artistObj this- view- assign totalNumberOfArtists The updates made to the removeAction method contain a multidimensional array containing key-value pairs the name and rating as the key and the artist name and artist rating as the values. With an if-else statement you can use the data to display an asterisk next to the artist name if the rating is 5 as shown in Listing 4-19. Listing4-19. php echo this- doctype XHTML1_STRICT html xmlns http 1999 xhtml xml lang en lang en head php echo this- headTitle - Remove Artist head body php echo this- render includes 108 Download at CHAPTER 4 VIEWS FORMS FILTERS AND VALIDATORS h3 Remove Artist h3 table tr td Artists - i Total Artists php echo this- totalArtist i td tr php foreach this- artists as artist tr td input type checkbox value php echo artist name name remove php echo artist name php if artist rating 5 php td tr php tr td input type submit value Remove x td tr table body html The view shown in Listing 4-19 expands on the example created initially to loop through the array elements and each artist so users can remove artists they no longer want to have on their list. This example introduced the if-else statements like the foreach loop you use PHP in much the same way as you would in any other situation. A .phtml file should now be seen as a PHP file. Figure 4-9 shows the results of this code. 109 Download at CHAPTER 4 .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.