TAILIEUCHUNG - Pro Zend Framework Techniques Build a Full CMS Project phần 9

Bây giờ các mô-đun liên lạc được tạo ra, bạn cần phải cấu hình ứng dụng của bạn để tải nó. Điều này đòi hỏi hai điều, bạn cần phải cập nhật các tập tin cấu hình ứng dụng chính và tạo ra một tập tin tải khởi động cho các mô-đun liên lạc. Để bắt đầu, mở các tập tin cấu hình (ứng dụng / configs / ) | CHAPTER 10 EXTENDING YOUR CMS public function indexAction Next you need to add a directory to the module s view directory for the index controller s views named index. Then add a new file to this directory named . Add a headline to the page for now as shown in Listing 10-3. You will add the actual contact form to this page shortly. Listing 10-3. The Default Contact Module Page in application modules contact views scripts index h2 Contact Us h2 Configuring Your Application to Load Modules Now that the contact module is created you need to configure your application to load it. This requires two things you need to update the main application configuration file and create a bootstrap file for the contact module. To get started open the configuration file application configs . First set the front controller s module directory to modules. Once this is set the front controller will automatically load each of the modules that are in this directory. Next set the module resource to an empty array. Then you need to override the setting you added earlier where you set the default controller to page. Set this back to index. Listing 10-4 shows the three lines you need to add. Listing 10-4. The Updates You Need to Make to application configs APPLICATION_PATH modules index The last step of configuring your module is to bootstrap it. If your module has a file named in its root with a class named Module _Bootstrap then Zend_Application will use this file to bootstrap your module. In the contact form s case there is not a lot of custom configuration required it needs only to reset the defaultControllerName. It will do this automatically since you set it in the configuration file. Create a new file in the root of your contact module named . Add a class to this file named Contact_Bootstrap

TỪ KHÓA LIÊN QUAN
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.