html5-img
1 / 6

Form API (FAPI)

Form API (FAPI). Intro to creating forms in a Drupal module. Drupal Balkan Summit, Novi Sad 8 – 9 October, 2011. What is it?. Drupal provides a standard, easy to use, easy to extend and secure way of adding forms to your Drupal website: Form API or FAPI for short.

ardith
Télécharger la présentation

Form API (FAPI)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Form API (FAPI) Intro to creating forms in a Drupal module Drupal Balkan Summit, Novi Sad 8 – 9 October, 2011

  2. What is it? • Drupal provides a standard, easy to use, easy to extend and secure way of adding forms to your Drupal website: Form API or FAPI for short. Drupal Balkan Summit, Novi Sad 8 – 9 October, 2011

  3. Understanding FAPI • Scary looking code// First name $form['first_name'] = array( '#type' => 'textfield‘, '#title' => t('First Name'), '#required' => TRUE, '#description' => t('Please enter your First Name.'), ); • Lot's of nested arrays • Lot’s of documentation Drupal Balkan Summit, Novi Sad 8 – 9 October, 2011

  4. Who should use? • Module developers • If you plan to modify forms provided by other modules • If you want to create settings page for your module Drupal Balkan Summit, Novi Sad 8 – 9 October, 2011

  5. What you need? • http://drupal.org/project/examples • Sample module with: • Menu item – to create a page that displays form • Callback function – returns content for the page • _form – function with form array • _validate – form validation • _submit – handles form submission Drupal Balkan Summit, Novi Sad 8 – 9 October, 2011

  6. Thank you! :) Questions? Drupal Balkan Summit, Novi Sad 8 – 9 October, 2011

More Related