Nạp HTML

1. Cú pháp nạp file html
2. Cú pháp có điều kiện
3. Điều kiện theo biểu thức
4. Nạp file theo điều kiện
5. Nạp giấ trị file tùy tham số đầu vào

1. Cú pháp nạp file html

<iif-H>TênFile</iif-H>
Ví dụ: <iif-H>phandau.htm</iif-H>
+ Mặc định lấy từ thư mục: /themes/macdinh/html
+ Muốn lấy thư mục khác: /App_Data/html/file.html
      <iif-H>/App_Data/html/file.html</iif-H>

2. Cú pháp có điều kiện
Nạp file có thể thế tham số
<iif-H>TênFile
<In-H></In-H>
</iif-H>


2. Cú pháp có điều kiện

<iif-H>
<GetVH>Giá_Trị</GetVH>
<HtmlH><ifVH:x1/>html1</HtmlH>
<HtmlH><ifVH:x2/>html2</HtmlH>
<HtmlH><ifVH:__ELSE__/>html_nofound</HtmlH>
</iif-H>

Ví dụ: in thứ
<iif-H>
<GetVH>2</GetVH>
<HtmlH><ifVH:0/>CN</HtmlH>
<HtmlH><ifVH:2/>Thu 2</HtmlH>
<HtmlH><ifVH:3/>Thu 3</HtmlH>
<HtmlH><ifVH:4/>Thu 4</HtmlH>
<HtmlH><ifVH:5/>Thu 5</HtmlH>
<HtmlH><ifVH:6/>Thu 6</HtmlH>
<HtmlH><ifVH:7/>Thu 7</HtmlH>
<HtmlH><ifVH:__ELSE__/>Khong xac dinh duoc</HtmlH>
</iif-H>

Ví dụ: xác định thứ từ tham số thu của URL
<iif-H>
<GetVH><iif-D>Url:thu</iif-D></GetVH>
<HtmlH><ifVH:0/>CN</HtmlH>
<HtmlH><ifVH:2/>Thu 2</HtmlH>
<HtmlH><ifVH:3/>Thu 3</HtmlH>
<HtmlH><ifVH:4/>Thu 4</HtmlH>
<HtmlH><ifVH:5/>Thu 5</HtmlH>
<HtmlH><ifVH:6/>Thu 6</HtmlH>
<HtmlH><ifVH:7/>Thu 7</HtmlH>
<HtmlH><ifVH:__ELSE__/>Khong xac dinh duoc</HtmlH>
</iif-H>


3. Điều kiện theo biểu thức

<iif-H>
<GetVH>Giá trị</GetVH>
<HtmlH><ifVH:=={0} biểu_thức_so_sánh /> x </HtmlH>
<HtmlH><ifVH:=={0} biểu_thức_so_sánh /> y </HtmlH>
<HtmlH><ifVH:__ELSE__/>html_nofound</HtmlH>
</iif-H>
Ví dụ:
<iif-H>
<GetVH>2</GetVH>
<HtmlH><ifVH:=={0}>=1 AND {0}<=3 />Vung 1-3</HtmlH>
<HtmlH><ifVH:=={0}>=4 AND {0}<=7 />Vung 4-7</HtmlH>
<HtmlH><ifVH:__ELSE__/>html_nofound</HtmlH>
</iif-H>



4. Nạp file theo điều kiện

<iif-H>
<GetVH>1</GetVH>
<HtmlH><ifVH:1/><typeH:File/>test1.htm</HtmlH>
<HtmlH><ifVH:2/><typeH:File/>test2.htm</HtmlH>
<HtmlH><ifVH:__ELSE__/>KO TIM THAY NHA</HtmlH>
</iif-H>

5. Nạp file tùy tham số thay đổi
<iif-H>tên_file
<In-H>
tham_số_1
</>
tham_số_2
</>
tham_số_n
</In-H>
</iif-H>
* và nội dung tên file có các tham số
<input_para>1</input_para>
<input_para>2</input_para>
<input_para>n</input_para>

Ví dụ:
file tes.html có nội dung
Xin chào <input_para>1</input_para>, bạn là <input_para>2</input_para>
khi gọi:
<iif-H>tes.html
<In-H>
Trần A
</>
Nam
</In-H>
</iif-H>
thì kết quả là: Xin chào Trần A, bạn là Nam
 

Mục liên quan: