Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Quản trị mạng
Pro Zend Framework Techniques Build a Full CMS Project phần 7
Đang chuẩn bị liên kết để tải về tài liệu:
Pro Zend Framework Techniques Build a Full CMS Project phần 7
Lâm Dũng
59
26
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
iếp theo tạo các phương pháp deleteAction () trong MenuItemController. Hành động này sẽ tạo ra một thể hiện mới của mô hình MenuItem và tìm thấy những mục trình đơn phù hợp với ID đã được thông qua để hành động trong các tham số URL. | CHAPTER 7 CREATING THE SITE NAVIGATION Next create the deleteAction method in the MenuItemController. This action will create a new instance of the Menuitem model and find the menu item that matches the ID that was passed to the action in the URL parameter. Next it runs the deleteItem method. Then it sets the menu parameter and forwards to the indexAction method. Listing 7-46 shows the complete method. Listing 7-46. The deleteAction Method in application controllers MenuItemController.php public function deleteAction id this- _request- getParam id mdlMenuItem new Model_MenuItem currentMenuItem mdlMenuItem- find id - current mdlMenuItem- deleteItem id this- _request- setParam menu currentMenuItem- menu_id this- _forward index Rendering Menus Now that the menu management component is complete you are ready to render the menus. To do this create a new action in the MenuController named renderAction . You can do this with Zend_Tool as shown in Listing 7-47. Listing 7-47. Creating the Render Menu Action with Zend_Tool zf create action render menu Zend_Navigation is a new component that has been developed to make managing your site navigation as easy as possible. To use Zend_Navigation you need to first fetch all items from the requested menu. Then load each of those items into an array. When this is complete you create a new instance of Zend_Navigation which you pass the array to. Finally you pass this to the Zend_View navigation helper as shown in Listing 7-48. Listing 7-48. TherenderAction Method in application controllers MenuController.php public function renderAction . menu this- _request- getParam menu mdlMenuItems new Model_MenuItem menuItems mdlMenuItems- getItemsByMenu menu if count menuItems 0 foreach menuItems as item label item- label if empty item- link uri item- link else uri page open id . item- page_id 138 Download at WoweBook.Com CHAPTER 7 CREATING THE SITE NAVIGATION itemArray array label label uri uri . container new Zend_Navigation itemArray this- .
TÀI LIỆU LIÊN QUAN
Pro Zend Framework Techniques: Build A Full CMS Project
Pro Zend Framework Techniques Build a Full CMS Project phần 1
Pro Zend Framework Techniques Build a Full CMS Project phần 2
Pro Zend Framework Techniques Build a Full CMS Project phần 3
Pro Zend Framework Techniques Build a Full CMS Project phần 4
Pro Zend Framework Techniques Build a Full CMS Project phần 5
Pro Zend Framework Techniques Build a Full CMS Project phần 6
Pro Zend Framework Techniques Build a Full CMS Project phần 7
Pro Zend Framework Techniques Build a Full CMS Project phần 8
Pro Zend Framework Techniques Build a Full CMS Project phần 9
crossorigin="anonymous">
Đã 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.