52. 字段API(中)

龸龵api龩龧龤龡龸龵龠龟龝龸龵龛龚龝龸龵龘龕龑龍龉龈龅龃龂齾齼齸齴齰龸龵龠龟龂龩龸龵齭齪齧齥齢齠齞齚齘齖龩龸龵齒齠齞齎龂龩齋齈龉齆齂齁鼽鼻鼹龩鼸龟龉龸龵龠龟齂鼻鼷齋齎鼳龩鼱鼳龑齠齞龠龟龉鼮鼬鼪鼦鼣龠龟鼟龡鼬鼜龉齋齎龂龩鼘鼻鼷鼗鼕齂鼻鼷鼒鼎鼱鼳龩鼱鼳龑齠齞龠龟龉鼍鼋鼊鼉龸龵鼗鼕龠龟龉龸龵龠龟齂齋齎龠龟鼈鼄鼀龸龵鼍鼋齂黼黻龩龉黺黹黵齂龡黴黰黮黬龈黪黧黣黠龸龵黪黧龂鼍鼋點鼄齠黚黖黔龩黓黐龉龸龵鼗鼕龠龟齂鼻鼷鼒鼎鼱鼳龩鼱鼳龑齠齞龠龟龉黌黰齆鼍鼋黊黼鼷鼬鼜龉黺黆鼬鼜黄鼄齪龈龸龵鼗鼕龠龟龩schema麱麭龂齒龈麬麫麩齠麦龩columns麛龂麚鼄齈龉黺黹黵齂龡黴黰黊黆龸龵龠龟鼍鼋麗麖黼鼷齠齞龩黓黐龉麔鼳龩齂麐麌龂龩body龸龵龉齆麃麂鹾鹻龝鹷鹵龝龘龕鹴鼷鼬鼜龉黺黆鼬鼜龂黊鼻鼷鼉龡龸龵龠龟龩鹰鼬鼜龉龠鹯龩黵齂鼒鼎齠齞鼄齪龠龟龂龩getMainPropertyName()麱麭麫麩龩鹛龸鹗鹖鹓鼋龅龩鹐鹎龈鹍鹉龂鹅鹄鹵鹂鸿鸻鼷鸺鸹鸸黼黻龸龵龝黼鼬鼜龸龵龉龈齠齞齚龩麗麖齘齖龉鼍鼋黼鼷龸龵龠龟鸷麖齢鼻鸶齎龂龉黺鸵龩齎鼊鼉鸷鸳齎龉黹鼍鼋鼻鼷龸龵鼻鸶齎龉黺鸵龩齎鼊鼉龸龵鸲鸯齎鸫龈齎龂鼻鼷龸龵龠龟鼍鼋鸪黊黼鼷齋鼋鸩鸨麗麖齆龩鼬鼜齠齞龉鸥鼦龅黮黬龈黪黧黣黠鼄齪龩龸龵鸡齂麗麖龈鸲鸯齎龂龉鼻鼷龸龵鼻鸶齠齞齎龉鸠齢鸞鸛麗麖鸘龈鼦鼣麗麖鸕黧龍龂鸒鸏鸌鸊鹗龸龵龠龟龩鸈鸇鼦鸃鸞鸂鸸

龸龵龠龟齂鼱鼳龑API齠齞鷷鷳龂龩齋齎齠齞龠龟龉鷲龩鷰鷮鼦鸃龡鸸

Drupal\Core\Field\FieldItemList

齒鷠鷞鸸Drupal\Core\Field\FieldItemListInterface齈

麬鼄齪龠龟龡鸸

Drupal\Core\Field\BaseFieldDefinition

齒鷠鷞鸸Drupal\Core\Field\FieldDefinitionInterface齈

齋齎龂龩鷓鷒齂鼻鼷鼒鼎齠齞龠龟龉鷰鷮鼦鸃龡鸸

Drupal\Core\Field\FieldItemBase

齒鷲齂鼸龟鸈鼱龉鷎鷌鷉鷇龸龵鷅龚鷄鷃龉麬鷠鷞鸸\Drupal\Core\Field\FieldItemInterface齈

麬鼄齪龠龟龡鸸

Drupal\Core\Field\TypedData\FieldItemDataDefinition

齒鷠鷞鸸Drupal\Core\TypedData\ComplexDataDefinitionInterface龉鶾鶽黺鶼鶹鷠鼦鸃齰鼒鼎齠齞鼄齪鷠鷞齈

龸龵龠龟龩龧龤鶷鶳黵齂鶲鶰鼋龅鶯鼷鼱鶬鶩龉鷇鼱鼳龸龵龠龟鼋鷅龚麱龕鷎鷌龉鷲黬鶥黼鷄鷃鶡鸸

Drupal\Core\Field\FieldItemBase

龡齰黪黧黺黆鷅龚麐麌鷎鷌齰龸龵鼱鼳鷅龚黪黧龍龉鶠鸂鸸

龸龵鼱鼳鷅龚黪黧龍鸸

鶳龍鶝鶜id鸸plugin.manager.field.field_type

鶕鶓麱龕鸸\Drupal::service('plugin.manager.field.field_type')

鷅龚鼄齪鶊麖鶇鶆鸸鶊麖齎cache_discovery 龩field_types_plugins鼗鼕

鷅龚麗麖鶇鶆鸸Plugin/Field/FieldType

鶂鵾鵻鵸鹛鸸field_info

龸龵鼱鼳鼱鹄鹵鼦鸃龩鷠鷞鸸Drupal\Core\Field\FieldItemInterface

龸龵鼱鼳鷅龚鸯鼪齰鷅龚鸩鼱鵷鵶龉黐鵵鵳鷅龚黪黧龍鼦鸃齰鼋鸂鷠鷞鸸

Drupal\Component\Plugin\CategorizingPluginManagerInterface

麐麌鷎鷌鼋鸂鵬鵨鼋鼦鸃鵳鸩鼱鷠鷞鸸

Drupal\Core\Plugin\CategorizingPluginManagerTrait;

鸠齢鷅龚鸩鼱鸒鶠鵣麐齋龩鷅龚鹰鵢鸂龃龉鶷鶳鵠鵜鵘鵖

龸龵鼱鼳鷅龚鵓鵏鼟龡鼻鵎鼱鼳龑齠齞鷅龚龉黐鵵龈鼱鼳龑鷅龚黪黧龍龂鹖鹓鷅龚鵌鵉齒鵅鵉齈Plugin derivatives鵃黔鸘龸龵鼱鼳鷅龚鴿鴾鼪齰鼱鼳龑鷅龚龉鴼鹄鹵鶾鶽龈鼱鼳龑鷅龚黪黧龍龂龩鷅龚id龡鸸

鴸field_item:鴴 + 龸龵鼱鼳鷅龚黪黧龍龂鼱鼳id

黹黵齂"field_item:FIELD_TYPE"鴤龕龉齧鹵鴠鴜鴘齰龉鷅龚鵌鵉鸒鶠鵣麐齋龩鷅龚鹰鵢龂龃鹗

龸龵鼱鼳鶡鼄齪鸸

鼄齪鼻鼷鼱鹛鼋Item鷷鴗龩鼱齒黺齂鴖鴒鴎鴍鼦鴊龉鴈鴄齸黔龩鴁鹛麱麭齈龉鳿鶆龈鳻鳸龩Plugin/Field/FieldType鼕鳵鸂龉鵳鼱鳳鳱鼦鸃鼋鸂鷠鷞鸸

Drupal\Core\Field\FieldItemInterface

鼍鳭鷄鷃鸈鼱Drupal\Core\Field\FieldItemBase龉鵳鸈鼱齾齼鼦鸃齰鼋龅鷠鷞龉鷄鷃鵏鼍齧鳫鳨鷠鷞龉鸯鳤鳢鹄鹵鼍鳭龩鳟鳜麱麭鳚鳙鳖鸊鹻鼄齪鳔鼍龉麱麭龩鳐鳨鳎鳋鳇鷠鷞龉黺鶼齋鳃鸊鹻龂龩鼻黆麛龩齭齪鸸

Category鸸齎鲿龸龵鼱鼳龩鸩鼱龉龈黣黠鲼鲻龸龵鵏鲸鳇鼪鲵鲴點鶆龝鲰鸯龝齠龸龝鹻鵣鲭鶥鼱鸩鼱龉鸞鲬齧點鶆鷰鷮龡鲵鲴點鶆

default_widget鸸龸龵龛龚龩鷅龚id龉鸯齢麚鲿鷰鷮龛龚

default_formatter鸸龸龵龘龕龑龍龩鷅龚id龉鸯齢麚鲿鷰鷮龘龕龑龍

no_ui鸸鲧鲣黻龉鸯齢麚鲿鵳龸龵鵶鲠鹖鹓UI鲜鲘鲗

cardinality鸸點鶆鷰鷮龸龵鲔鲒龩齠黚齒鲐鲏鵏鼍鼋鲋鼒鲐鲏黼鲊齈

鹅黹鼍鼋鲉齞鹄鹵鲇鲻鶡鲆鹄鹵鸯鼪龩麛龉點鶆鲄龩鸊鹻龈hook_field_info_alter()龂鼍鼋鳟鳜鶂鵾

齁黼鸒鸏鳎鱿鶠麐麌齾齼鼄齪龩龸龵鼱鼳鹗

鶾鸸鼋鸂龩龸龵龛龚龝龸龵龘龕龑龍鳖齎鵖API黊鱻鱷鱴麐龉鸞鲬鱳齂鱰鵣麐齋鱬鲧鱩鱥鱢鱟龉黌黰鼕鱝鱚鱗黊齰鸌鼪齎鵖api龉鱔鼪齧鱒鱐龩鱎麱齧鸯鼀鱊龉鶥鱆齰鸌鳔鼍龉鼋黣鲸黼鱂鳟鳜鹐鹎鹗

龸龵龛龚Field widget鸸

龸龵龛龚鸯齢鸕黧龸龵鰿鰾鲐鲏鵏龉齎鵖龂鸞鸛鰺鲿黺鼷龸龵龉鼻鼷龸龵龈齎鵖龂鰺鲿鵏龉鰹鰹鼍鼋黊黼齢鼻鼷龩麱麭龉鵠鸞麗麖鰸鳭鰶鰴龩龸龵鼍鼋齂鸂鰰齋齎龝鵖鳭鰮龝鼒鳭鰮齥齥龉鱿鶠黪黧黣黠鰸鶷鶳鼱鼳龩鴸黪黧齎鵖鰺鲿鴴齒鸞鸸/admin/structure/types/manage/article/form-display齈龉龡鵵麐麌鷎鷌龸龵龛龚鲜鸕黧鵳鰪鼟龉龸龵龛龚鼋鷅龚麱龕鷎鷌龉鰨鷎鷌齰龸龵龛龚黪黧龍鹗

龸龵龛龚鷅龚黪黧龍鸸

鶳龍鶝鶜id鸸plugin.manager.field.widget

鶕鶓麱龕鸸\Drupal::service('plugin.manager.field.widget')

鷅龚鼄齪鶊麖鶇鶆鸸鶊麖齎cache_discovery 龩field_widget_types_plugins鼗鼕

鷅龚麗麖鶇鶆鸸Plugin/Field/FieldWidget

鶂鵾鵻鵸鹛鸸field_widget_info

龸龵鲐鲏龛龚鼱鹄鹵鼦鸃龩鷠鷞鸸Drupal\Core\Field\WidgetInterface

龸龵龘龕龑龍field formatter鸸

龈鼦鼣鰺鲿鵏龉鼮鲻龈龅齖龩鼘鼷龸龵鰹鰹鼍鼋黊黼齢鼻鵎龩麱龕鳟鳜鰺鲿龉鱿鶠黪黧黣黠鰸鶷鶳鼱鼳龩鴸黪黧鰺鲿鴴齒鸞鸸/admin/structure/types/manage/article/display齈龉龸龵龘龕龑龍黵齂鸯齢鸕黧龸龵鸞鸛鰺鲿龩龉鷲鳖龸龵龛龚鼱鰥龉黹齂鼋鷅龚麱龕鷎鷌龉鰨鷎鷌龸龵龘龕龑龍鷅龚黪黧龍鳟鳜黪黧鹗

龸龵龘龕龑龍鷅龚黪黧龍鸸

鶳龍鶝鶜id鸸plugin.manager.field.formatter

鶕鶓麱龕鸸\Drupal::service('plugin.manager.field.formatter')

鷅龚鼄齪鶊麖鶇鶆鸸鶊麖齎cache_discovery 龩field_formatter_types_plugins鼗鼕

鷅龚麗麖鶇鶆鸸Plugin/Field/FieldFormatter

鶂鵾鵻鵸鹛鸸field_formatter_info

龸龵鲐鲏龛龚鼱鹄鹵鼦鸃龩鷠鷞鸸Drupal\Core\Field\FormatterInterface

龸龵鰣鶆龠龟鸸

齧齂黊龸龵鼄齪龠龟黰鰠鸥鼦龅龸龵鰣鶆龠龟鷠鷞黵鷄鷃齰龸龵鼄齪龠龟鷠鷞龉鰝鲇齰set龝add麱麭龉龡齰鸌鼈麗麖鰜鵢鵓鵏鱚鷄鷃齰鰣鶆鼦鼣鷠鷞齒鶠鵣麐齋龩鰣鶆鼦鼣鹰鵢齈龉麬鷠鷞鸞鸂鸸

Drupal\Core\Field\FieldConfigInterface

麐麌鼦鸃齰鼍鳭鷄鷃龩鸈鼱鸸

Drupal\Core\Field\FieldConfigBase

龸龵鸥龚鸕黧鸸

龡鰚鹯龸龵鼄齪龩CRUD鰔鼟龉鹄鹵鲗鰓鰒鰎龍龠龟龉麬鷠鷞龡鸸

Drupal\Core\Field\FieldDefinitionListenerInterface

鷰鷮鼦鸃鸸Drupal\Core\Field\FieldDefinitionListener

Drupal\Core\Field\FieldStorageDefinitionListenerInterface

鷰鷮鼦鸃鸸Drupal\Core\Field\FieldStorageDefinitionListener

鵵鰇麐麌鷎鷌齰鸥龚龠龟龉鸥龚鸕黧鵃黔鳎鳋鳇鵣麐齋龩鸥龚鵌鱬龍鹰鵢鹗

齒龂龃鰃龉鸂龃鸘鹐鹎鰂鸂鰀鯼龉鰨龈鯺鸠鳻鳸龂鷄鯷鹐鹎龸龵api齈

鼟鯶鯴鸸

鹂鯰龈鯭鯬鼋鱝龉鼉鯩鯨鼻鼷鯥黵鼍鼋鰃鯣龉鯠鯞黵鯛鶡鰃鯣鹓鯗黼龉黌鵏鯩鯨鵘鵖龉黐鵵黊鯗黼鯖鯕鰪鯒鯐龉鵏鯎鯊鯆2017鯬鮹龉鮵鮱鰎鼪鴸鯖鯕鴴齰龉黓黐鮰鷷齰鶯鮮鸸

鼻龝html5鮩鲜齰鵷鵶龅龩鮦鶥鷎鮥龉鵠鸞鮤鲧鰔鼟齥龉鵷鵶龩齸鶥鰹鰹鶽鮣鼀鰔鼟龩鼒鮠龉鹄鹵齁黼鰀鯼

鮟龝鮜齢鮙鮘鼦鵏龩鰔鼟鮕鮔鯩鯨齾鮓鮏鯣齰鼻鼷鹯鸯鯒鱥龉鯞鳤鼣鮋鮏鯰鯗鲋鹵龉龠js鹵鮄鯗鼽龉鳃鸃齰鸲鮀龩鱝魾鯒鱥魼龝鸲鮀龩魸齖點魵鯐

鹴龝魳魾魯魮龩鼒鮠龑龉鹵魫魧鼪魣魟魾龝魛鰿魾龝鷇鼱鶥魙鸩魗魖龩魒魐齥齥

鲭龝鼽鰨鱬龝鶥魍黚鮩鲜龩魊魉

鮰龩鲜魇黵齂麐麌鮏鯰魅鲜魅鼒鮠龝魅鲜魅魃鶥龉鷷鲬鬿鱆鬾鲸鸩鰪魅鲜魅鸏龑龉鴈鼷鼣鯥龩鬽鬹齂黊黖龩龉鯗鮱鯖鬵鬱鬰龉黺鼷鸃龟齧鬮鱬鵉龈鯩鯨鳜鬫龉龈鲒黼麱齖鸡黊鼣鸃龉龈黔鬧鬫鸸鵠鸞鬦鯬鬢鵬鬠鬟鼍鼋鯛鶡鬧鼻鬜鬙鵃龉鴼黊鯥鼍鼋鯛鶡鬧鼻鬜鸃鬕龩鬒鬏鯞鵃黰鰠鰺鮓齧鵶龉龈鬌鬈魸鸸黊鯗黼黮黬鬆鬃鵶鸒龩鶩鬁髿髾龉髺髷髶龝髵黐髴髳齥齥龉髱黬鰹鰹鱚龈黼鼷髭髫鬧髪髧髥龉鴼鸃龈鯗鮱鰎鼪黊髤髢齥鼽龩鯥髟龉龈髞髜魸鵓鸵鸞鵵龉黮齧鯺鰿齂鯥齧高髗鳨龉鹯鵳齂鸩鰪魅鲜魅鸏龉龈體鼣鰮鬜鸂鰸鼻鼷魙髭髫黵鵶髑鵖鼷鯥髍麬鼻鵉龉黺鵎鸩鰪鸏龑龩鳟鯒鱚龈鷄鯷鹗

鯠鯞髢髉鼋魇鼪鼋龅黺黆齂髇齢drupal髇鬕髅龩髃鱟骿骽龉drupal骻鼦鯗鶥龉鸞鲬鹅鬽鱟髇鬕髅龉黌黰鹄鹵鯗骹龩鵏骶齒鯠鯞齾齼骵鹓鼻鯬齰齈龉鱟鼪黣齖黹鲒齾齼骲鹂齰鱝齖龩鸏龃龉drupal體鼣鷷鷳齂鯗鵘鵖龩龉鰸鼷鸏龃鬵鸩黹齧鮱黧鸌龉鴼鹵骮鯖骪鬽鸏鬱鬰齂骨鮱龩龉黐龡鸏骧骤龃骣黼龉黺鵎魃鶥鯒骢鳖鯥黊黖鬽鬹髢骶龩骠骜魅鲜魅鶥龉髤鵏骘鳟龩鵷鵶骕骓麐麌龈齧骒鲼鲻髇鬕髅龉鴈鯥龩鹂骑鱚齂黊骍骉骇龩龉黺鯗鶳骅鱴骮鼪鰔鼟麐麌龉鼕鱝黺鼷骄魸龅黊鼍鵶麖龈鼻鼷鯥鯖骪齰鸌鹓linux髇鬕髅龩骁鰠黮骮鹯鵳齧鲸黊龉黵驾齰鸌鹓麬龂龩tcp驽驼龩鯥鸡鯗鲊驹鹗

驷齢黮黬齖龠龩黺鵎驵齖龉黹鲒鱟鯶鹯鵳齴體鶡鲆龩鬈驳麱麭龉齧鹵驰鮄鯣龡鸥鸥驮鰀龩drupal骵鯥龉鴈鹯鵳驰鮄驫黰鼽驪驦鸯鶡鲆黊黖龩鬽鬹龉鸏龃龅鹄鹵鵏鸃鳋鸃鬈龉龈黺鼷驣驟鸂龉鸒驝龩鹻驚黵鮏鯰驖鲵鲋鹵龉麐麌齂黊鵃麦鯣龩龉鷇鬵鸩麦鼎龈鼻驒龉鵖鯛鳇鬕髅鯗鮱龉鬦驏鸯鯶鹄鹵齰鸌鰸鬵鸩龩鶷鶳鵏龉黊驌龠鼜鹐鹎鰨驈驅鼪鳋驃鯶髉鸕驵齖龩鹻驚黵齂鴎鲄龩鹻驚龉黺鸵龩鹻驚鹯鵳齂鳻鳸龑龩龉齧騿點鳋驃鯶齾齼鰀騾鯺騺鰀鯼龉騸鯶驝黚鲊騿點龉龈鹐鹎鯺騺鰀鯼鵏鳢鷎鷌鷠鷞鹐鹎龉鵣麐齋鼋黣鸘鲸鼣鸃黺鼻鮮鹗

黌黰鸞鸛鶩鱬鳃黺鸵龩鹻驚騴鰠騳鮓鱗黊鯥鵶鯖骪鬱鬰龉黌黰黵鹄鹵騰騮騭騬龉鬦鰸鼻鼷鯥鹾龈齰鸌鰸鬵鸩鸏龃鵏龉騫騩騥鼀鹂骑骍骉骇鸘麬鸒驝龩鳙鳃鲜龉鰨騡鶾鵏骶龝騞鵣龝驣驟騚鼟鯶鰿鰾龉鶥騘鸡黺黰鼉齰黌黰鸘鮔驦鮔騕龉黺黵齂鶩髇龩鬽騔髉龈鹗

本书共83小节:

评论 (写第一个评论)