TAILIEUCHUNG - Beginning Zend Framework phần 5

Xác định mức độ thường xuyên thu gom rác thải là chạy (mặc định là 1 / ). Thiết lập phông chữ sử dụng. Thiết lập kích thước phông chữ sử dụng. Thiết lập chiều cao hình ảnh được sử dụng cho CAPTCHA. Thiết lập chiều rộng của hình ảnh được sử dụng cho CAPTCHA. | CHAPTER 4 VIEWS FORMS FILTERS AND VALIDATORS Table 4-11. Zend_Form_Element_Captcha Setters Function Description setExpiration Determines how long a CAPTCHA image should reside in the server accepts time in seconds . setGcFreq Determines how often garbage collection is run the default is Hcvalue you set . setFont Sets the font to use. setFontSize Sets the font size to use. setHeight Sets the image height used for CAPTCHA. setWidth Sets the width of the image used for CAPTCHA. setImgDir Sets the image directory that holds the images to use for CAPTCHA. setImgUrl Sets the image path to use for the CAPTCHA. setSuffix Sets the file name suffix for the images the default is .png . Let s add a CAPTCHA to the sign-up process to demonstrate its use see Listing 4-41 . Listing 4-41. Using a CAPTCHA Create the sign up form. private function getSignupForm Create Form form new Zend_Form form- setAction success form- setMethod post form- setAttrib sitename loudbite Add Elements require Form LoudbiteElements new Elements 150 Download at CHAPTER 4 VIEWS FORMS FILTERS AND VALIDATORS Create Username Field. form- addElement LoudbiteElements- getUsernameTextField Create Email Field. form- addElement LoudbiteElements- getEmailTextField Create Password Field. form- addElement LoudbiteElements- getPasswordTextField Add Captcha captchaElement new Zend_Form_Element_Captcha signup array captcha array captcha Figlet wordLen 6 timeout 600 captchaElement- setLabel Please type in the words below to continue form- addElement captchaElement form- addElement submit submit submitButton form- getElement submit submitButton- setLabel Create My Account return form Before loading the URL let s go through Listing 4-41. The code shown replaced the creation of the username password and email fields with your application-specific Elements class and created the new CAPTCHA form element. To create the CApTcHA element yoU instantiated a Zend_Form_Element_Captcha assigned its name .

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.