TAILIEUCHUNG - Beginning Zend Framework phần 3

chúng tôi sử dụng tên duy nhất trong một biên tập thời trang và vì lợi ích của chủ sở hữu nhãn hiệu hàng hoá, không có ý định xâm phạm-: tên và đánh giá là khoá, và tên các nghệ sĩ và đánh giá nghệ sĩ là các giá trị. Với một lệnh if-else, bạn có thể sử dụng dữ liệu để hiển thị một dấu hoa thị bên cạnh tên nghệ sĩ | CHAPTER 3 WRITING CONTROLLERS USING ZEND_CONTROLLER application- bootstrap - run The updated file contains new routing information by first fetching an instance of Zend_Controller_Front then fetching its router and finally adding a new route using addRoute . The addRoute method accepts two parameters an identifier for the route and a Zend_Controller_Router_Route object. Save the file and load the URL http localhost artist store which then loads ArtistController artistaffiliatecontentAction . So how does it work When a URL is fetched within an application the front controller looks at the URL and then looks at the declared routes to determine whether there are any URL patterns that apply to the user s request. If the URL matches one of the patterns specified by the routes the request loads the controlleraction pair specified in the Zend_Controller_Router_Route second parameter. On the other hand if the URL pattern does not match any of the routes the user is shown an error message. With the changes saved let s create a new view for the artist store. Create the file with the XHTML shown in Listing 3-8 and save the file in the application views scripts artist directory. Bring up the URL in your browser http localhost artist store. Listing 3-8. DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD html xmlns http 1999 xhtml head title - Artist Products title head body Product 1 - Test body html You know how the controller handles the user s requests and how to mask the URLs to give them a more user-friendly pattern. Now let s see how to pass variables through the URL. Passing Parameters with Route You might sometimes implement code that retrieves parameter information from a query string such as http localhost artists name metallica or http localhost user username armando. Using Zend_Controller_Router you can allow users to

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.