TAILIEUCHUNG - Mastering Joomla! 1.5 Extension and Framework Development phần 3

Tuy nhiên, thông tin chứa đựng trong cuốn sách này được bán mà không có sự bảo đảm, thể hiện rõ ràng hay ngụ ý. Không phải là tác giả, xuất bản Packt, cũng không phải các đại lý hoặc nhà phân phối sẽ được tổ chức chịu trách nhiệm về bất kỳ thiệt hại nào | Chapter 4 For each major entity you should identify the tasks associated with each. You can use the table in the previous section which identified common task and method names to help identify tasks. We have seen how to build models views and controllers but we have yet to see how we actually use them. To get started we need to create a PHP file named after the component in the component s frontend folder and we need to create a PHP file named after the component and prefixed with admin. in the component s backend folder. These files are executed when the component is invoked via the frontend and backend respectively. This example shows how we might implement one of these files Check to ensure this file is included in Joomla defined _JEXEC or die Restricted Access get the controller require_once . instantiate and execute the controller controller new MyextensionController controller- execute JRequest getCmd task display redirect controller- redirect You will often find that these files are relatively simple. In the above example we get the controller class file instantiate a new controller execute the task and redirect the browser. The redirect method will only redirect the browser if a redirect URI has been set use setRedirect to set a redirect URI and optionally a message. We can do far more with these files if we wish but often we do not need to generally it is better to keep the processing encapsulated in controllers. It is common practice to use multiple controllers one for each entity. These are generally stored in a folder called controllers in files named after the entity. Each controller class is named after the entity and prefixed with MyextensionController. When we use multiple controllers we generally use the URI query request value c to determine the controller to instantiate. This demonstrates how we can deal with multiple controllers Check to ensure this file is included in Joomla defined _JEXEC or die Restricted .

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.