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

Planning and Developing the Core Framework * @param String data : if the tag value = condition then extra tag is replaced with this value */ public function addAdditionalParsingData($block, $tag, $condition, $extratag, $data) { $this-apd[$block] = array($tag = array('condition' = $condition, 'tag' = $extratag, 'data' = $data)); } We will want to get a list of all the template bits we need to process into the page (processing is done by the template object). /** * Get the template bits to be entered into the page * @return array the array of template tags and template file names */ public function getBits(). | Planning and Developing the Core Framework @param String data if the tag value condition then extra tag is replaced with this value public function addAdditionalParsingData block tag condition extratag data this- apd block array tag array condition condition tag extratag data data We will want to get a list of all the template bits we need to process into the page processing is done by the template object . Get the template bits to be entered into the page return array the array of template tags and template file names public function getBits return this- bits We also need to get our array of additional parsing data for the template handler to process. public function getAdditionalParsingData return this- apd We often need to just access a specific loop block within our page this method makes this easy by searching for us using regular expressions and returning it. Gets a chunk of page content @param String the tag wrapping the block -- START tag -- block -- END tag -- return String the block of content public function getBlock tag echo tag preg_match -- START . tag . -- . -- END . tag . -- si this- content tor tor str_replace -- START . tag . -- tor 0 tor str_replace -- END . tag . -- tor return tor ------------------------------------ 52 ----------------------------------- Download from Wow eBook Chapter 2 Obviously we need to get the content from the page so we use the getContent method. public function getContent return this- content Finally when we are ready to output the content to the browser we do some final replacements. These are of template tags that we want to have in a template but may not always replace. One example is a registration form if the submission has errors we would replace the form fields with the user s submission attempt. If however the user is viewing the form for the first time they wouldn t want to see anything so we would either have to explicitly remove the template tags or instead prefix them with form_ and any .

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.