2. 请求对象Request及请求堆栈

drupal8龦龥龤龠Symfony龒龎龌龉龈Symfony龅龁龀齿齼齹齵齴齲龦齱齮齪齨齦齣齡龁齟齞齝齼齹龈齛齘齗齓齏齎齌齋齈龈drupal8齇龦齃齗龈鼿齘鼾齮齼齹鼽齌龌鼺齲龦龥龤齨齦鼸鼶龈鼴齮鼸鼶齪鼳鼯鼾齮齈鼫龈鼩鼥齮鼣鼠鼝鼛鼚

龥龤齨齦鼸鼶齇龦龁鼖齞鼔鼒鼸鼶鼐鼍鼊鼇龈鼴齮鼸鼶齪鼅齘鼂鼔鼒鼁齈鼇齈鼫齓齏鼀黼黻黺齝齼齹黸黶黳黯黫黩黦黳cookies黳session默默黗黓黑黐黎黋龈黉黅齈鼫黂黂鼔鼸麾鼸鼶麼麻龈齴黼麸麵龈齃齵麱麮龈麫齞麾麧麥麤麡麠$_POST黳$_GET黳$_COOKIE默默麆麅麄麁鼚龁鹿鼊鹼黻黺齨齦鼸鼶齇鹹黶鹿齱鹸鹵鹲齝鹰鹮龈鹭齃麻齘鹫鹹鹧鹤鹠鹝鹚龈鼴鹗鼣鼠鹕麻齘鹒鼊鹼齝鹑鹍齱鹸黗黓龈鹋齲鹊齱鹉鹆龈鹃齋鸿鸾龈麻齘鸼龉鸺鸷齝黗黓鼩鸳鸱齝鸮鸭鸬鸫鸩鸦鼚

齱齮鸢黓鹲鸠黸黶鸞鸛齝齨齦鼸鼶龈齼齹鸢黓鹋鸞鸛齟齞鼸鼶龈齟齞麻鹮鸘鸕鹒鸓鼠麄麁龈龁鹿鸞鸛鸒齱鼠麄麁龈龠麄鸠麻齘龥龤鹒鸓鸐齨齦鼸鼶龈鸎鼸齝鸋鹲鸠黸黶鸞鸛齝齨齦鼸鼶鸇龁鸅齨齦鼸鼶龈鸅齨齦鸃鸐齨齦鼩鸁黶齨齦鷿鷼鷹鷶鸭鼚

drupal8麫鼀鷳鷰齝鷯麆黻黺鹿Symfony齝齨齦龒龎龈齨齦鼸鼶齝鷮鹤鹠鷫鷨鷧\vendor\symfony\http-foundation\Request.php

鸾鼔黋鸩鸩鼴齮齨齦鼸鼶鷧鸞鸛鸅齨齦鷧

$request = Request::createFromGlobals();

鼴齪鼅$_GET, $_POST, $_COOKIE, $_FILES, $_SERVER黗黓麆鸠黑黐鸦齨齦鼸鼶$request鷹龈Request鷮鶲鶱鹧鹤鹠齱齮鶭鶫麤鸞鸛Request鼸鼶龈鶭鶫鸞鸛齝鼸鼶麱鶧龦Request齝鶥鶣鼚鶭鶫龦齱齮鶠鶜龈鶙鶗麮齓鶖鸦Request鷹龈鶒鶑鶎鶍鶉麄麁鶇鷧

Request::setFactory($callable);  
$request = Request::createFromGlobals();  

鼴鶲鶱鸺鼸鶃鶂齝齨齦鼸鼶鶁齌鶀鵼龈鼸鸞鸛齝齨齦鼸鼶鹫鹹齱鹸鹵鹲黗黓默默鼚

龠鶭鶫鵺麻齘鶥鶣齡齱齮鵷鵴鹿Request鷮齝鷮龈鵲鵰齝鵭鹹鹿鵫鵧鹚鼚

龠Reques鷹鵦鵥鵢鹿鵠鵞鼊鵝鷧Reques::create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null)黺齘鸢黓鹧鹤鹠齝uri鸞鸛齱齮鸐齨齦鼚

Reques鵥鵢鹿麡麠session齝鹮鵖龈鵒黶齱齮鶥鵎鹿Symfony\Component\HttpFoundation\Session\SessionInterface麥鵉齝session鼸鼶麼麻鷧

$request->setSession(SessionInterface $session);

鼸$_GET, $_POST, $_COOKIE麄麁齝鼝鼛麆鸠鵆鼁鵅黗鸘鼸鼶鶁齌鼝鼛

\vendor\symfony\http-foundation\ParameterBag.php

龉鴾齝鴻龎鵆鼁FileBag鼸鼶鼝鼛龈鴹鴵鴴黯黫黗黓鵆鼁ServerBag鼸鼶鼝鼛龈鴱鴮齝http鴫黗黓鵆鼁HeaderBag鼸鼶鼝鼛

齱齼鴨齝get鼊鵝麻齘鴮鸦黼黺齝齱鹸黗黓

齨齦鷿鷼鷧

龠齼齹鼽齌鷹鵆鼁齨齦鷿鷼鼸鼶鼝鼛齨齦鼸鼶龈齨齦鷿鷼鼸鼶鹤鹠鹿齱齮鴥鷨齨齦鼸鼶齝鷿鷼黗黓鴢鴠鴞鶙鶁黉鴜鴛龈龠麄鸠鹋龦鵆鼁php黗龒鶥鵎龈鴗鴓鹿鼥齮齨齦鼸鼶龈鴏鴎鴊龦鸅齨齦鼚

齨齦鷿鷼鼸鼶鹒麸鴆龈齨鸩鷮鹤鹠\vendor\symfony\http-foundation\RequestStack.php

本书共63小节:

评论 (写第一个评论)