基础篇11. 添加services,开启twig debug模式

OK龴龳龱龮龪龨龤龢龠龞龚Drupal console龴齹齸龳龱齷齶齲齯settings.local.php齝齜齚

齗齔39齍龴齌齊齆齅齁鼽齍鼹鼶齊齆鼳齌鼰鼮鼬鼩鼧services齚(鼡鼠鼟鼬鼧鼛鼗龴齌鼧鼹鼶鼕龴鼔鼑鼎鼌鼧齍鼋齊鼊鼇鼄鼀黼龴黺黷鼛黳鼑黲黰黭)

/**
 * Enable local development services.
 */
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';

龳龱麾麻麹麷麶鼽麷齍鼹鼶龴麳麲麹麮齝麭鼕鼧麬麩齚

/**
 * Enable local development services.
 */
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/default/local.services.yml';

鼽麬麣鼧麠麝麛麗麓龴麐麎麊麇麅龳龱麄麁settings.local.php齝齜齚麀麇黷麮龚鼳齌鼇麄麁麷鹼鹻鹷鹵鹲鼧鹰麗鹭鹪龴鹩黰鹨鹥鹤鹢鼧鹡鹝龴鹙黰鹖鹡鹝鹥鹤鹢齚鼄齆龴鹓麬鼧龴鼽鹼齝齜齗麓git鹏鹍鼧鹉鹇鼑黲鹅鹁鸿齚

鸼鸺龳龱鸹齗default齝齜鸵鼕麄麁麷鹼local.services.yml齝齜齚

鸳鸱齗齝齜鼕鸭鸫齝麭鼕鼧鼹鼶齚鸳鸩鸨齝齜齚

services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory

parameters:
  twig.config:
    debug: true
    auto_reload: true
    cache: false

鼽鸊鼧9齍鼹鼶龴麅鸈齍黷鸄鸁鷽鸨麓鼧龴鷼黰鷹鹤齚鷷麮龳龱鷶鷵鷴鷱鸹鷭鷫鷨settings.local.php齝齜鼕鷫齍鷤鷣龪鼊鷟鷜齚

齔7齍黷鼰鼮twig debug鷔鷐龴鼽麬鹖齗鷍鷌鷋鷉鷔鷈鼧鹉鹇鷅鷃齌鶿麓龚鶾麷鹼鷔鷈龴鸳鶺齌麷鶸鶴鶰麓鼧鷔鷈麁鶯齚鸄鼠鷔鷈麛鷔鷈麁鶯龴龳龱齆鸺鷴鹖鶮龴鼽鸊龴齌鶪鷱鼊鶦twig debug鷔鷐鼰鼮鶥齊齚

齔8齍黷鹻鶠鶝鶜龴鶘鶕麮true鹉龴麷鶓鶏鼹鼶鹅麻麹龴鶍鹖鹻鶠鶊鶜齲鶆twig鷔鷈齚

鼽鶂鼎鼌齗鼽鸊鹥鵾黷黰鵺鷱鼧龴鶴鵷鵴鵱齝麭鼔auto_reload鼧鵮鵭鵪 https://www.drupal.org/docs/8/theming/twig/debugging-compiled-twig-temp… 龴鵱鵡鵠鵝鵛鼬鵚黷鵘麾鵘鵖龴黭鵓鵚麳鼽鼌鵒鵏麾齚

鼄齆鼽鸊鵋鵈麷麶龴鵅鵂齌鴿鴾鹻鶠鶊鶜齲鶆鼹鼶鴻黰鴷鴳鼰鼮twig debug鴱鼊龴齌龪鵺鷱鴮鼽鶂鼎鼌齚

齔9齍黷鸄鸁鷽鸨齚

鸼鸺龳龱鶿麓Drupal console鼧鴫鴨鷽鸨鴦鴤 drupal cr all 麾鴫鴨鷽鸨龴齆鴡鴝鼽鹼鼬鼩鼧service齝齜齚

鷶齁鴙鷋龴鶝鶜鷋鷉齆鸺齊齆齅齁龴齗鼹鼶鴗鴔鴐鴎龴鴍龚麐鴍鴉鴆鼧鴃鴁鼹鼶龴鼽鶍鵮鵭twig debug鳽鳺龨龤鼰鼮龚齚

本书共75小节:

评论 (写第一个评论)