Menu

9/30/21

Bóc tách layer ra subview cho gọn

 Chúng ta có 1 trang layout html-css code nhìn rất rối, ta nên tách ra thư mục subview theo từng phần head.php, header.php, content_left.php, content_right.php, footer.php rồi dùng câu lệnh include để insert vào trang layout nhé!


Trang layout sau khi đã bóc tách:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <?php include 'subview/head.php'; ?>
</head>
<body>
<!--  Free CSS Templates from www.templatemo.com -->
<div id="templatemo_container">
	<div id="templatemo_menu">
       <?php include 'subview\menu.php'; ?>
	   
    </div> <!-- end of menu -->
    
    <div id="templatemo_header">
    	<?php include 'subview\header.php'; ?>
    </div> <!-- end of header -->
    
    <div id="templatemo_content">
    	
        <div id="templatemo_content_left">
        	<?php include 'subview\content_left.php'; ?>
        </div> <!-- end of content left -->
        
        <div id="templatemo_content_right">
        	<?php include 'subview/content_right.php'; ?>
        </div> <!-- end of content right -->
    
    	<div class="cleaner_with_height">&nbsp;</div>
    </div> <!-- end of content -->
    
    <div id="templatemo_footer">
    
	      <?php include 'subview/footer.php'; ?>
    <!-- end of footer -->
<!--  Free CSS Template www.templatemo.com -->
</div> <!-- end of container -->
<!-- templatemo 086 book store -->
<!-- 
Book Store Template 
http://www.templatemo.com/preview/templatemo_086_book_store 
-->
</body>
</html>

Cấu trúc thư mục subview:








No comments:

Post a Comment