Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'embedding perl in html with mason chapter 8: building a mason site-p1', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 8 Building a Mason Site-P1 This chapter covers in detail a full-fledged working web application. Our application is the Perl Apprenticeship site at http apprentice.perl.org . Back at O Reilly s 2001 Open Source Conference Adam Turoff suggested that the Perl community needed a site where people who had project ideas but either not enough time or not enough expertise could hook up with other programmers who could supply the missing pieces. An experienced developer with a really neat idea and not nearly enough time to do it can post a project idea and offer to mentor a less experienced developer in its implementation. Conversely a less experienced developer with a really neat idea who isn t quite sure how to go forward on it can look for a mentor to help him bring that idea to life. This is a pretty basic database-backed web application the kind of thing that Mason gets used for all the time. It didn t require anything too terribly complicated but it shows off a number of Mason s features quite well including how components can be used to isolate individual site elements autohandlers and dhandlers and a simple use of method blocks. One thing worth noting is that for database access we chose to use Alzabo which is a project created and maintained by Dave Rolsky. Alzabo is a database-to-object mapper built on top of the DBI. It allows us to easily create Perl objects representing things in our database like users or projects. We will not be going into detail on our schema or our Alzabo-related code here as this is largely incidental to the goal of this chapter. Our hope is that if you don t understand any particular piece of the Alzabo functionality you can just treat it as pseudocode.1 More information on Alzabo is available online at http www.alzabo.org . Alzabo is also available from the CPAN. The code for the site is available at this book s site http www.masonbook.com . This includes an installer that should help you get the site up and running without too