7.1 基本概念

Drupal 8龦龤龡龝龙Form API龄龀齼齺齶齴齲齱齮齪齨龄齤齡齝齙齗齓齒HTML齆齂鼿

Drupal 8鼼鼺鼹鼶鼲鼯鼮齲齱齮鼯齼齺鼬鼩鼥鼬龦鼢鼠POST鼘鼕鼿

鼑鼎鼌鼊鼇齙鼆齮鼅鼃龝龙齱齮鼀黽黹黵黲齪龦龤齱齮鼯鼩鼥鼶黯齪黮黭黬黩齱齮鼶黦鼮齲黥黢龦鼢鼯點黜鼿

Drupal 8鼀齪齱齮齶齱齮黛黙黕黑黐黏鼿

黋黊黆黄 https://www.drupal.org/docs/8/api/form-api/introduction-to-form-api

1鼬齱齮黵黲

  • type: 齱齮麛麚齪麗textfield, textarea, html5麋麉麇tel,email,number,date,url,search,range鼠

  • title: 齱齮麅麃

  • value: 齱齮麀

  • default_value: 齱齮鹺鹷麀

  • weight: 鹶鹴齪鼼鹱鹭齱齮黵黲鼯鹬鹨

  • placeholder: 鹧鹬鹥齪麗鹡鹠鹟齂鼯黋鹜鹛鼀鹙鹖"鼘鹡鹠鹟齂"

2鼬齱齮黛黙

\Drupal\Core\Form\FormStateInterface黐黏鹉鹅龡齱齮齶點黜鼯鹂鸿黛黙鼿齱齮黛黙麉麇龄鸻龦鼢鼯點黜齶齼齺黛黙鸸鸴鼿齱齮龦鼢黭鼯鹴黽鸳鼬齱齮鼩鼥齶齱齮龦鼢黕黑黬黩form state鼮齲鼯鼿

3鼬齱齮鸮鸫

Drupal鸩齱齮齨龄龝龙鸮鸫齱齪齤鸫鸧龡黬黩齱齮齼齺鼯麅鸤鹥鼿鸢鸞Drupal鼃齨龄AJAX鼩鼥齱齮鸕鼼鼺鸑鸏點鸋鸇鸄鼿

本书共79小节:

评论 (写第一个评论)