Smarty instance tutorial - template design section -2

xiaoxiao2021-03-06  79

Smarty instance tutorial - template design section -2

Author: teacherlxj Document Type: Posted Visitor Statistics: 242 Source: 9cbs Time: 2004-08-22 08:40:02 instance 3.  ==================== ============================== Example3.tpl  =============== ============================================                   Some functions     {* The following paragraph is equivalent to defining a variable in the template UserName *} {Assign var = "username" value = "Master"                                                                                                                                     \ = $ Checkname Checked = $ ischecked Output = $ VALUE SEPARATOR = "
"                                      {{html_radioes name = "radiobox" value                                                                                <          


Copyright (c) by xiaojun, Li 2004 {mailto address = "teacherli@163.ccom" Text = "Contact the author"}                          =================================================

==== example3.php =========================================== ============ template_dir = './Templates/'; $ smarty-> compile_dir = './Templates_C/'; $ smarty-> config_dir = './configs/'; $ smarty-> cache_dir = './cache/'; $ smarty-> caching = false; // -------------------------------------------------- ------------------------------------ // Handle {HTML_CHECKBOXES name = "checkbox" value = $ checkname Checked = $ ischecked Output = $ value separator = "
"} // ------------------------------- -------------------------------------------------- ----- $ Smarty-> Assign ('Checkname ", Array (    =>"         =>                                                                                                                           => '外语')); $ smarty-> assign ('ischecked', 1001); // - -------------------------------------------------- ----------------------------------- // Handle {HTML_RADIOES Name = "Radiobox" VALUES = $ radioname checked = $ IsChecked Output = $ value separator = "
"

} // ----------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------- $ Smarty-> Assign ('Radioname ", Array (                                                                                                                          ? ', 1001); // ------------------------------------------- ------------------------------------------ // {html_select_date} No processing Automatic output // ------------------------------------------- -----------------------------------------            .tpl ");?> =========================================== =========== xPLE3.PHP output effect: ================================= ======================   Some functions in the template   {Assign Var = "username" value = "Master"           Username = Master Master                                   BR> language
Mathematics
Foreign language <

BR /> below this line will display 3 Radio:
Mathematics
Foreign language
The following shows a month, day, annual selection box:

> 01

Value = "22"> 22

CopyRight © 2020 All Rights Reserved
Processed: 0.039, SQL: 9