друпал 7 - создание формы в админке модуля - drupal 7 create form
Primary tabs
например так:
/*эта функция выводит форму с настройками модуля*/ function lightmirror_form($form, &$form_state) { $queryResult = nodes_to_text_file_retrieve_content_types(); $options = array(); while($record = $queryResult->fetchAssoc()) { $options[$record['type']] = t($record['name']); } $form['nodestypes'] = array( '#action' => '#', //The action attribute of the HTML form tag 'name' => array ( //We define a simple text field for the "name" '#type' => 'textfield', '#title' => t('My pretty name'), //The label that will be placed with the field '#description' => t('My descrition'), //The description will be placed right below the field '#required' => TRUE, //If true the system will perform a simple check on submit so that it is never empty ), 'submit' => array ( //We define a simple submit button '#type' => 'submit', '#value' => t('My submit'), ), ); return system_settings_form($form); }
- yii-primer's blog
- Log in to post comments
- 4902 reads