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小节:

评论 (写第一个评论)