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

本书共71小节:

评论 (写第一个评论)