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

本书共78小节:

评论 (写第一个评论)