基础篇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齌黶麅鶠鶟鶛龴麰鶘鷴麚鼺auto reload鼸麈鶕齝龴鸵齖鶓鶑鶎鶋龡龞麰鼡鶇齝龴鼸黶麵麈鶅鶄鶕齝齚

齕9齌黶鸊鸈鸇鸤齚

鹀鸽龱龮鷅麚Drupal console鼡鶁鵾鸇鸤鵼鵹 drupal cr all 麺鶁鵾鸇鸤龴齂鵶鵵鼸麈鼦鼣鼡service齠齝齚

鷼鼺鵳鷒龴鶟鶛鷒鷏齂鸽齅齂鼾鼺龴齖鼶鼲鵯鵭鵪鵦龴鵢龙麗鵢鵠鵝鼡鵜鵚鼶鼲龴鼸鵘鵔鵐twig debug鵏鵌龨龥鼮鼪龙齚

本书共56小节:

评论 (写第一个评论)