71. 主题引述

龺龸龶龲龯龬龩龧龦龣龠龝龙龗龕龔龐龍龊龈drupal龶龲齳齲齰齮龩龶齭齩齨齥齢齞drupal龯齛齗齖龩齓齏齍齉齈齇龈龶龲龗齃齂鼾鼺齗齖龩龊鼹龗齃鼶鼴鼳鼰齇龶龲齂龩鼮鼪鼩鼦鼥鼡鼟php齂龶龲龯齛齗齖龩鼚鼗鼓鼒齭鼐鼎鼋龩鼇鼄鼃齩黿黻黸齉齈齂齇龈龶龲龩黴黰黯黬黫黧黥黢黡黟點齂黝黚龩默黗黕黔齂齥齢龩龔黐龊龈龶龲龯齛齂齈黏鼎鼋龩黕黍黌齂黈黅黅黄黃麿黡麻鼒龩麺黍麶麳龗齃齂麯麬麩麧麣龩麢麠麝麚麬麙麗龩鼴麔黡麐鼐麏麍齭黻黸齉齈麋麇龸龗龕龔鼶麢麍齭齂麅
黕麂鹾鹼麢麗齩鹸鹷鹴齂鹳鹯鹸鹷龊龶龲鹬龗龕黅黄龩麝龗龕鹨鹦黡鹤鹡鹞鹝龩鹸鹷龸齗鼶黈鹛齞鹙鼡鼒齂鹗鹔鹒齂drupal龶龲龯齛齨鹎黰龩鹌齞龶龲龯齛齗齖黴龗齃齇龈鹎齉鹊龧龦鹉鹅麅

默黗麗齩龸龶龲鹁麢麠麝鹀鸿黝黚麩龶龲鸼龸黬黫龩鸹齓龸龶龲龔麯麬鸸鸵齂龊龈鸲麳鸮齭齂鼎鼋鼐龩麶黴麺黍黅鸪鸧鸤鼡鸣齂鸡黍鸝鸜鸣鸛龈鸗黧齉齈鸔龙龩黿龍龶龲龔鸑黌麧麣龗齃鸍龶龲齳齲齂鸌鸉黧鸅鸃麅

drupal龶龲龗齃齂鸁鷾鷻
drupal龶龲龗齃鷸龝鷶鷲龩麢鷰齓鸑鷮鼇黥黰鷭龶龲龩黥鷪麠鷨鷤鷡鷠鼩齮鷜鷙鼺黧pc鼺龩鼴麔鷪麠鷨鷓黢鷒鷎齭鷍龩麢鷰齓鷉鷈鼺龝鷄鼇黥鼡鷁齂龶龲龩鷀龶龲龗齃齂鷶鷲鶾鶽鼡鶺鼴鶶龩鶳鶱鶯鷉鷁黰鶮鷮鼐黈麢鷰齓鶫鶧鶦鶥鶤鸉鼇黥鼡鷁齂龶龲龩龗齃黿鶣鷤齥齂鶢鼶鶞鶝鶛鶚鹀龩鸲鼴鷉pc鼺麏鷜鷙鼺麢鷰齓齞鼡鷁鶗鶕鶒黥鼡鷁龶龲龩鶑鶎鼡鷁黥鶊鶒黥鼡鷁鶆鶂龩鶤鸉鼶鶦鶥齂龩鶢麍齭鵾鵼鶳鵹黰鶮龶龲鵷鵵鵳鷰麅

yaml鵭鷨鷻
齲黗yaml黅鸉齂鵬鵪鵦鵢麺鵞 http://www.yaml.org/ 鵞鶯黡鼓鼒鹞鹝龩鼡鵎龊鼹龩黕麂鵊鼚鼗黰黯鵉鶥鵇鵆齏鵅鵄鷻
鷉鵀鴼齂info黅鸉黈龩鶢黡'type', 'core', 'name'鼶鴪鴩齂龩鼴麔鴦齥麩'version'鴛鸑鴗黗'VERSION'龩麋麇龔鶒黥drupal齂鳾龸鳻鹌齞鵀鴼齂鳾龸鳻鳹\Drupal::VERSION鳴
drupal黈鼴麔php齂'yaml'鵀鴼鳱鷉麋麇龔鼇黥YamlPecl::class鳨龈龠yaml黅鸉龩鼴麔鼡鳱鷉麋麇鳤鳠鼇黥YamlSymfony::class鳨龈龠龩鼾齨黡麻鳝齂鶾鸁龩鷀齞麩鹙鶧鷉鼡鷁鳙鳘鳔齂黰鳓鶾龩鷉鳒龠鹙鶧鹁黰鳏鼇黥黿齨麅
鼴麔麢黴yaml齇龈鼡齉麏齨黍鳌鳋鵢龩鷰齓鳇鳅鼇黥龗齃鼚鼗齂鳃鳁鳨鳀鲽yml黅鸉齓鲼鲺鲷鲴龩黕麂鼶黰鶮鲱鲰鳹鵦鷉鲭鲪鲨黈鲤麬鳴鷻

        $data = [
            "str"                => "字符串",
            "str_with_space"     => "yunke 云客",
            "str_with_quotation" => "'' \"\"",
            "str_with_slash"     => "\\/",
            "str_with_brace"     => "{}[]",
            "str_with_colon"     => ":",
            "str_null"           => "",
            "str_newline"        => "yunke\nyunke",
            "int"                => 123,
            "int_str"            => "123",
            "float"              => 3.14,
            "bool_true"          => true,
            "bool_str"           => "true",
            "null"               => NULL,
            "arr"                => ["one", "two", "three"],
            "arr_key"            => ["a" => "one", "b" => "two", "c" => "three"],

        ];
        $data = \Drupal\Core\Serialization\Yaml::encode($data);
        file_put_contents("yunkeyaml.yml", $data);
        $data = \Drupal\Core\Serialization\Yaml::decode($data);
        var_dump($data);

鼴麔麍齭齩鱠黰鶮yml黅鸉龩鷰齓鼇黥齓鳔鱜鱛鷻
$data=\Drupal::service("info_parser")->parse($filename);


龶龲齳齲鱔鲗鷻
鱐麚麍齭鱌鱈鶆鱄麏龶龲鱁鼶drupal齂鵀鴼龩黡鹁鰽鼃鼇黥鱔鰻鰸鵀鴼鰵龩麢麍齭鼎鰳黕鰲鷰鸁鼶鴦鶆鱄麶鷰鸁鼶鴦龶龲龩鷉鰱龝鶗鳘鳔鼟鰰鷄鴦鰬鼶鰸鶆鱄鵀鴼鰵麏鰸龶龲鵀鴼鰵龩麏齨麢麍齭鶫鶧鰪鼹鶯鳔黅鳨鰦鰢鼶鴦鰠鰜麇龩齓鳔鼶黰黯黧龶龲齳齲齂鱔鲗齏鰘鸧鰗鷻

鰔鲨鱔鷻

鰑鰏龶龲鵀鴼鱔龩鸑鰌鰊黰龩鼶鼋鷄龶龲齂鰊黰鰇鼋龩鳨龣黗 info 黅鸉齂黅鸉鱔龩鼴鰸 bartik.info.yml 鰵麋麇鰔鲨鱔鰅鼶鰸 bartik 鰵龩鼡鸁鰂鸧鹷鵭龩鰀鯽齞鷻 /^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/ 龩黡黯鰰齥鱔鲗鯪鯩鷒鷎麝鰀鯽龩鷀鼡鸁鯧鼇黥龩鼴鰸 template 鰵鯤鳔黅黈鯠鯝鰰鷄鯙鱌龩鯘鼚鼥龶龲鱔鹁鯕鴦鰔鲨鱔麅

齗鯔鷰齩鱔鷻

info 黅鸉黈 name 鵆鴦齥齂鱔鯒龩黕鷰齓黧鰔鲨鱔齳鷁麶鷰鼡鷁龩鯏鲰鷉 UI 黈龩鸁鰂鯋鹷鵭

鯈鯇鱔鷻

鳱鯃龶龲齳齲黅鸉齂鯈鯇鱔鯒龩鵉鶥鷻龶龲齂鯂鮾麙鮽鶳鶱鶯鼶鷉麙鮽齰齮鷒鷎齭鷍鳹齰齮黈鴪鴩黡 type 鮺鶾鳴齂齓鰸 .info.yml 鰵黿鮶鮴鮱齂黅鸉龩鶚鼡鼶鮯鶧鯈鯇鮴鮫鮨鮦龩鮢鶶龶龲齂鯈鯇鱔鷰齓黧鰔鲨鱔鼡鷁龩鷀鹗鮞鶳鮜麠麝齳鷁龩鯈鯇齉鮘鸍鮴鮫鼡鮖龩鯈鯇鱔鼡鸁鼇黥鷻 'src','lib','vendor','assets','css','files','images','js','misc','templates','includes','fixtures','Drupal',

黕黯鯈鯇鷉鯧鯂鮾鹁鼟鯧鮒鮎鳹鷰齓鮊黥黕鮇鰰鶾鮄鮂鼒鮀齂龶龲龩鼡鼟黴龗齃魿魻鶦鼳魹鷪鳴

龶鵀鴼黅鸉鱔鷻

鶞鶝齞鰸鰔鲨鱔 . 鵀鴼鯔魵鰵龩鼴鰸 bartik.theme 鰵魳鰸 search.module 鰵龩龶鵀鴼黅鸉鼡鼶鴪鴩齂龩黥黗鳱鯃鶆鱄麏龶龲麍齭齂魯鹙麏齥鰗魭鼪龩齢黗鵀鴼鶫鯈鯇龩鼶黰鶮 php 黅鸉龩鷀魪鼡齓 php 魩黅鸉鱔黿鮶龩鼴麔鳱鷉鯽鯧鶞鶝黸魥麅魢魞龶龲鼶黰鶮鰰魝魙魗龩魕齂龶鵀鴼黅鸉魒鱔齞鰸魢魞鱔 .engine 鰵龩鼴鰸 twig.engine 鰵麅

龶龲鵀鴼鯔魵鷻

黰魑鳨鯙龶龲鵀鴼鼶鳨齥鰗鷮鼐魎魍齂龩鷉 info 黅鸉黈 type 鵆齂鶛齞 theme 龩黕鼶龶龲龯齛齗齖麍齭齂鵀鴼鯔魵龩鷀魢魞龶龲鼶黰鶮魋魎鷻

drupal8 鷰齓鷁鹁鼇黥鼒鶮鶆鶂魢魞龩鶞鶝鶒黥 twig 龩鼴麔麢黡麍齭麶鷰齓鷁鹁鼇黥 Smarty 鴗龩黰鶮鶆鶂魢魞黴麠黰鶮魢魞龶龲龩鶞鶝齂 twig 黴麠齂魢魞龶龲鼶 \core\themes\engines\twig 龩鷉 info 黅鸉黈魢魞龶龲齂 type 鶛齞 theme_engine 龩齞鰜麇鯙魕鼶魢魞龶龲魉魆鮢齞黕黔齂鵀鴼鯧鯃魃鷉龶龲鯈鯇黈龩齞鰜麇鯙鼶魋魎魉魆鮢齞魀龸鬾鶯鼶黰鶮黧鶆鱄鯔鬺齂鬷鸁魵鸌鸉龩魪鼡齥鰗魎魍龩鼴鬵黥龶龲魢魞魳麙鮽龶龲鬳鬰齥鰗鴗

龶龲齂鬮鬬鷻

鷰齓黰鬪黰鬪齂鬮鬬鳔鷠龩鬪鹙鼡鮖龩鷀鬩鶮龶龲鶢黡黰鶮鳇鳅鸼龶龲鳹鬥龶龲鳴龩麶鰅鼶鰸鵼鸼鼒鬪鬮鬬鰵龩黕黧 php 鯔鬮鬬鯔鬺麅

drupal 鼇黥鼒鶮鶆鶂魢魞鹁龩鼴麔鷉龶龲鬮鬬鬣黈龩鬰龶龲黧鸼龶龲鴦齥麩鼡鷁齂龶龲魢魞龩麋麇龔齓鶫鸼龶龲齂鷤魃齞鬢麅

鯘鬞鱌麩鸼龶龲黿龩鰅鬝鷙鬞鱌麩鸼龶龲鮯鬛龩鷉 info 黅鸉黈鼡鴪鬘鷙鴦齥

鬮鬬鬣黈鬩黰鶮龶龲鱁麍齭鯧鬗鬓鬏黥

龶龲鵀鴼鯃魃齢魃鷻

鷰齓黡鬌鶮鸡黍龩鬋麚鬉鬈鬇鳹鬅鬋麚鬉鬄鬁髽鬋麚鬉鳴鷻

themes

sites/all/themes

sites/your_site_name/themes

黡鬮鬬魙魗鹁龩鬰龶龲鷰齓鯃魃鷉鬥龶龲齂鯈鯇黈龩鷀魪鼡鹾鹼黕黔魩龩鷉鯈鼾齂鶳鵹鳹 drupal8.5 鳴黈黴黕鮇魙魗齂鼰齇麶鳱鷉 bug

龶龲 info 黅鸉齂髻黸鶞鶝鶛鷻

龶龲 info 黅鸉鯧龗齃齩鱠鹁鼟髻黸鶞鶝鶛龩鶒黥鹙鸌鰸 + 鰵髹鹌龩默鶶鷰鵢鷉髶黡鴦齥髲鵆鹁魕鼟鼶鰜麇黔鬰龩鶞鶝鶛鯧齥鰗鷉龶龲鼰齇鲨黈龩鼴鳔鷻

$defaults = [
      'engine' => 'twig',
      'base theme' => 'stable',
      'regions' => [
        'sidebar_first' => 'Left sidebar',
        'sidebar_second' => 'Right sidebar',
        'content' => 'Content',
        'header' => 'Header',
        'primary_menu' => 'Primary menu',
        'secondary_menu' => 'Secondary menu',
        'footer' => 'Footer',
        'highlighted' => 'Highlighted',
        'help' => 'Help',
        'page_top' => 'Page top',
        'page_bottom' => 'Page bottom',
        'breadcrumb' => 'Breadcrumb',
      ],
      'description' => '',
      'features' =>  [
                   'favicon',
                   'logo',
                   'node_user_picture',
                   'comment_user_picture',
                   'comment_user_verification',
  ],
      'screenshot' => 'screenshot.png',
      'php' => DRUPAL_MINIMUM_PHP,
      'libraries' => [],
];

默黗鶒黥鹙鸌黿髻黸髹鹌龩鸹齓鯘鼡齍齭髢鶞鶝鶛鹁龩麍齭鬝齥鰗麝鶛龩鸲鼴鼡齍齭鸼龶龲麋麇麍齭鱌點齥鰗齞 FALSE 龩髡鯽鶞鶝齞 'stable' 龶龲麅

鶞鶝鶛鯧髻黸黿龩鼟髠齛 system_info 髞髝鬳鷻

$moduleHandler->alter('system_info', $theme->info, $theme, $type);

黕麂 $theme \Drupal\Core\Extension\Extension 黴髜 info 鼶黴髜魎髻黸齂髙高鮺鶾龩齰齮鼶麠黥麩鶞鶝鶛齂 info 黅鸉齰齮鹙鸌龩 $type 鶛齞 'theme' 龩鶆鱄鷰齓髗鮎 hook_system_info_alter() 鷠髞髝魕龩鳅髕鬌鶮髑鹙龩髍黰鶮黧髍鬌鶮髑鹙鶳鶱鶯鼶鰂鸧鷉 Extension 黴髜黈齂龩默黗 php 黴髜鶞鶝鼶髊魢黥髈鬈鸹齓鶆鱄鷰齓髞髝麝黴髜鳹髞髝 $info 鹙鸌髑鹙龔鷓鹌黥龩魕鼡鼶魢黥髈鬈鳴龩默黗髠齛鬳鬰齂髄鮢龩鶥髂髁麚鬗鬓齂鶆鱄鷰齓髞髝黿黌鰀鷉鬗鬓龶龲齂 info 黅鸉

鶆鶂黅鸉魒鱔鷻

鼡鸁鰬鵹鳔骽骺鰸 _ 鰵龩鳔骽骺鼇黥龐鲗鲔鰸 - 鰵鰠骹龩齳骸龶龲鬳鬰黈鶢鸁鼇黥鳔骽骺龩龐鲗鲔黥鳔骽骺鰠骹麅

骵骱鷻

  1. info 黅鸉麂黌鵉鶥鹷鵭齂骭龲龩鼴鰸 'base theme' 鰵鵆鹴魻麩鰸 'base theme' 鰵龔骬鷠鹌黥龩麋魹鷪麩鹙鸌骨鱔龩鷉鵅骧 info 黅鸉鹁鹗鳝骥鲪髞髝龩鲼鲺黕黯骢骭龲麅

本书共88小节:

评论 (写第一个评论)