Get Smarty

Donate

Donate Bitcoin Bitcoin
Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap eyeglasses from Cheapglasses123.com and save up to 80%.

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Brautkleider auf Topwedding.de

Find free files to download on allwhatyouwant.net

Looking For Affordable Wedding Dresses 2015 at Best Prices On TDBridal.com

Shop high quality cheap prom dresses on Dresswe.co.uk

Buy New Arrival Cheap Prom Dresses 2015 at JDBRIDAL Prom Dress Store

Advertisement

{html_radios}

{html_radios}鏄竴涓 鑷畾涔夊嚱鏁锛岀敤浜庡垱寤篐TML鐨勫崟閫夋缁勫拰鎻愪緵鏁版嵁銆 璇锋敞鎰忛粯璁ら変腑鐨勬儏鍐点

鍙傛暟鍚嶇О 绫诲瀷 蹇呴夊弬鏁 榛樿鍊 璇存槑
name string No radio 鍗曢夋鐨勫悕绉
values array 蹇呴夛紝闄ら潪浣跨敤options灞炴 n/a 鍗曢夋鐨勫兼暟鎹
output array 蹇呴夛紝闄ら潪浣跨敤options灞炴 n/a 鍗曢夋鐨勬樉绀烘暟鎹
selected string No empty 閫変腑鐨勯」
options 鏁扮粍 蹇呴』, 闄ら潪浣跨敤values 鍜 output灞炴 n/a 鍗曢夋鐨勫-鏄剧ず鐨勬暟缁
separator string No empty 瀛楃涓蹭腑鍒嗛殧姣忛」鐨勫瓧绗
assign string No empty 灏嗗崟閫夋鏍囩璧嬪煎埌鏁扮粍锛岃屼笉鏄緭鍑
labels boolean No TRUE 鍦ㄨ緭鍑轰腑澧炲姞<label>鏍囩
label_ids boolean No FALSE 缁<label> 鍜 <input>璁剧疆ID灞炴
escape boolean No TRUE 灏嗚緭鍑轰腑鐨/杞崲(鍊兼绘槸浼氳杞崲)
  • 蹇呴』璧嬪肩殑灞炴ф槸valuesoutput, 闄ら潪浣跨敤options鏉ヤ唬鏇裤

  • 鍏ㄩ儴鐨勮緭鍑烘爣绛鹃兘閬靛惊XHTML瑙勫垯銆

  • 浠讳綍涓嶅湪涓婇潰鍒楄〃涓殑閿煎灞炴э紝閮戒細琚緭鍑哄埌<input>鏍囩涓綔涓哄睘鎬у拰鍊笺

Example聽8.13.聽{html_radios}绗竴涓緥瀛


<?php

$smarty->assign('cust_ids', array(1000,1001,1002,1003));
$smarty->assign('cust_names', array(
                              'Joe Schmoe',
                              'Jack Smith',
                              'Jane Johnson',
                              'Charlie Brown')
                              );
$smarty->assign('customer_id', 1001);

?>

  

妯℃澘锛


{html_radios name='id' values=$cust_ids output=$cust_names
       selected=$customer_id separator='<br />'}
   
  

Example聽8.14.聽{html_radios}绗簩涓緥瀛


<?php

$smarty->assign('cust_radios', array(
                               1000 => 'Joe Schmoe',
                               1001 => 'Jack Smith',
                               1002 => 'Jane Johnson',
                               1003 => 'Charlie Brown'));
$smarty->assign('customer_id', 1001);

?>

  

妯℃澘锛


{html_radios name='id' options=$cust_radios
     selected=$customer_id separator='<br />'}

  

涓婇潰鐨勪袱涓緥瀛愰兘杈撳嚭锛


<label><input type="radio" name="id" value="1000" />Joe Schmoe</label><br />
<label><input type="radio" name="id" value="1001" checked="checked" />Jack Smith</label><br />
<label><input type="radio" name="id" value="1002" />Jane Johnson</label><br />
<label><input type="radio" name="id" value="1003" />Charlie Brown</label><br />

  

Example聽8.15.聽{html_radios} 鏁版嵁搴撲緥瀛(濡 PEAR 鎴 ADODB):


<?php

$sql = 'select type_id, types from contact_types order by type';
$smarty->assign('contact_types',$db->getAssoc($sql));

$sql = 'select contact_id, name, email, contact_type_id '
        .'from contacts where contact_id='.$contact_id;
$smarty->assign('contact',$db->getRow($sql));

?>

  

杈撳嚭锛


{html_radios name='contact_type_id' options=$contact_types
     selected=$contact.contact_type_id separator='<br />'}

  

鍙傝{html_checkboxes}{html_options}

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 15 plus 10? (Are you human?)

Advertisement