Bây giờ phương thức tồn tại để hiển thị các hình thức, bạn cần tạo một tập tin đó sẽ gọi phương thức đó. File này sẽ được gọi là , và nó sẽ nằm trong mức độ gốc của thư mục nào (/ công / ). Tương tự như , tập tin này hoàn thành như sau: • • • • • • tải các file khởi tạo. Thiết lập một tiêu đề trang và mảng file CSS. Bao gồm tiêu đề. Tạo ra một thể hiện mới của lớp Lịch. Gọi displayForm () phương pháp. . | CHAPTER 5 ADD CONTROLS TO CREATE EDIT AND DELETE EVENTS Caution You may want to include a time limit for tokens to increase security further. Making sure a token is no older than 20 minutes for instance helps prevent a user from leaving a computer unattended and having a mischievous user start poking around later. For more information on tokens and preventing CSRF visit Chris Shiflett s blog and read his article on the topic at http csrf. Creating a File to Display the Form Now that the method exists to display the form you need to create a file that will call that method. This file will be called and it will reside in the root level of the public folder public . Similar to this file accomplishes the following Loads the initialization file. Sets up a page title and CSS file array. Includes the header. Creates a new instance of the Calendar class. Calls the displayForm method. Includes the footer. Next add the following inside the new file php Include necessary files include_once . sys core Output the header page_title Add Edit Event css_files array include_once assets common Load the calendar cal new Calendar dbo 171 CHAPTER 5 ADD CONTROLS TO CREATE EDIT AND DELETE EVENTS div id content php echo cal- displayForm div -- end content -- php Output the footer include_once assets common After saving this code navigate to http to see the resulting form see Figure 5-1 . Figure 5-1. The form before adding any CSS styles Adding a New Stylesheet for Administrative Features Obviously the preceding form needs some visual enhancement to make it more usable. However this form will ultimately be accessible only to administrators because you don t want just anyone making changes to your calendar so the CSS rules will be separated out to a separate stylesheet called . You can find this file in the css folder public assets css . Again since this book