TAILIEUCHUNG - Thiết kế mạng xã hội với PHP - 20

Tham khảo tài liệu 'thiết kế mạng xã hội với php - 20', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Profiles and Statuses public function addTemplateBit tag bit replacements array if strpos bit views false bit views . this- registry- getSetting view . templates . bit this- page- addTemplateBit tag bit replacements As mentioned above we need to take this parameter in the method in the page object this method also needs to be changed to assign both the template bit and the replacements array with the template tag and not just assign the template bit with the template tag as it previously did. This can be achieved by putting the template bit and replacements array into an array and assigning them with the template tag in the bits array. This is highlighted in the code below Add a template bit to the page doesnt actually add the content just yet @param String the tag where the template is added @param String the template file name @param Array the replacements array return void public function addTemplateBit tag bit replacements array this- bits tag array template bit replacements replacements Now that we have the additional information being stored where we need it we need to process it when we actually insert the template bit into the page. This simply involves iterating through the tags and performing a simple find and replace on the content of the template bit importantly only on the template bit then placing the content generated into the main template as before. The highlighted code below illustrates the changes Take the template bits from the view and insert them into our page content Updates the pages content return void private function replaceBits ------------------------------------ 172 ------------------------------------ Download from Wow eBook Chapter 5 bits this- page- getBits loop through template bits foreach bits as tag template templateContent file_get_contents template template tags array_keys template replacementsl tagsNew array foreach tags as taga tagsNew . taga . values array_values template replacementsi templateContent .

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.