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

本书共88小节:

评论 (写第一个评论)