SimpleTest một số phép thuật ở đây. Khi trường hợp thử nghiệm thực hiện, nó tìm kiếm cho tất cả các phương pháp bắt đầu với "thử nghiệm" và chạy chúng. Nếu phương pháp này bắt đầu với bất kỳ tên nào khác, nó sẽ bị bỏ qua. Chúng tôi sẽ tận dụng điều này, nhưng bây giờ chỉ cần nhớ để "test" vào đầu của mỗi phương pháp, bạn muốn | the PHPTAL equivalent would be td tal content username Dummy user name td PHPTAL is supremely friendly from a web designer s point of view. WYSIWYG HTML editing tools generally ignore unknown attributes and PHPTAL lets you insert dummy content that will make the template look like the real web page when viewed in a WYSIWYG HTML editor or in a web browser for that matter. Figure shows what a PHPTAL template for the user list looks like when opened as a file in a web browser. User administration Login name First Name Last name Email address Type victor Victor Ploctor victor@example com regular Edit 1 elietta Elietta Floon elietta@example com webmaster Edit Figure PHPTAL template viewed in web browser This is possible because of PHPTAL s ability to insert example content that disappears when the real application is run. Let s look at the PHPTAL template see listing . Listing PHPTAL template for user list DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD html xmlns http 1999 xhtml head title User administration title head body div id content h1 User administration h1 table id AdminList cellspacing 0 tr th Login name th th First Name th th Last name th th Email address th th Role th th th tr tr tal repeat user users Which template engine 305 td tal content user getUsername victor td td tal content user getFirstname Victor td td tal content user getLastname Ploctor td td tal content user getEmail victor@ td td tal content user getRole regular td td a href id user getID class CommandLink Edit a td tr tr tal replace td elietta td z td Elietta td td Floon td td elietta@ td td webmaster td td a href id 42 class CommandLink Edit a td tr table div body html o The DOCTYPE declaration was generated by HTML Tidy. It expresses the fact that this is an XHTML document. PHPTAL will be just as happy if we replace it with a plain XML declaration .