WIKI使用導(dǎo)航
站長百科導(dǎo)航
站長專題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢
- 虛擬主機
- cPanel
- 網(wǎng)址導(dǎo)航專題
- 云計算
- 微博營銷
- 虛擬主機管理系統(tǒng)
- 開放平臺
- WIKI程序與應(yīng)用
- 美國十大主機
System settings form():修訂間差異
來自站長百科
無編輯摘要 |
無編輯摘要 |
||
第3行: | 第3行: | ||
'''system_settings_form($form)''' -- | '''system_settings_form($form)''' --很重要的一個函數(shù),在設(shè)置后臺表單時候經(jīng)常用到。主要用于為一個表單添加按鈕和設(shè)置前綴. | ||
'''參數(shù)''': | '''參數(shù)''': | ||
第13行: | 第13行: | ||
表單結(jié)構(gòu)。 | 表單結(jié)構(gòu)。 | ||
'''實例''': | |||
<pre> | |||
<?php | |||
function onthisdate_admin() { | |||
? $form = array(); | |||
? $form['onthisdate_maxdisp'] = array( | |||
? ? '#type' => 'textfield', | |||
? ? '#title' => t('Maximum number of links'), | |||
? ? '#default_value' => variable_get('onthisdate_maxdisp', 3), | |||
? ? '#size' => 2, | |||
? ? '#maxlength' => 2, | |||
? ? '#description' => t("The maximum number of links to display in the block."), | |||
? ? '#required' => TRUE, | |||
? ); | |||
? | ? return system_settings_form($form); | ||
? | } | ||
? | ?> | ||
? | </pre> | ||
[[category:API|D]] | [[category:API|D]] | ||
[[category:Drupal|D]] | [[category:Drupal|D]] |
2010年7月11日 (日) 17:09的版本
導(dǎo)航: 上一頁 | 首頁 | DedeCMS | 帝國CMS | Xoops | SupeSite | PHPCMS | PHP168 | Joomla
system_settings_form($form) --很重要的一個函數(shù),在設(shè)置后臺表單時候經(jīng)常用到。主要用于為一個表單添加按鈕和設(shè)置前綴.
參數(shù):
$form 一個包含表單結(jié)構(gòu)的關(guān)聯(lián)數(shù)組。
返回值:
表單結(jié)構(gòu)。
實例:
<?php function onthisdate_admin() { $form = array(); $form['onthisdate_maxdisp'] = array( '#type' => 'textfield', '#title' => t('Maximum number of links'), '#default_value' => variable_get('onthisdate_maxdisp', 3), '#size' => 2, '#maxlength' => 2, '#description' => t("The maximum number of links to display in the block."), '#required' => TRUE, ); return system_settings_form($form); } ?>