Chapters
23 Chapters
|
2:20:28
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
13.
All about services.yaml
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This tutorial also works great for Symfony 6!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.3.0 || ^8.0.0",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"knplabs/knp-markdown-bundle": "^1.8", // 1.9.0
"sensio/framework-extra-bundle": "^6.0", // v6.2.1
"sentry/sentry-symfony": "^4.0", // 4.0.3
"symfony/asset": "5.0.*", // v5.0.11
"symfony/console": "5.0.*", // v5.0.11
"symfony/debug-bundle": "5.0.*", // v5.0.11
"symfony/dotenv": "5.0.*", // v5.0.11
"symfony/flex": "^1.3.1", // v1.21.6
"symfony/framework-bundle": "5.0.*", // v5.0.11
"symfony/monolog-bundle": "^3.0", // v3.6.0
"symfony/profiler-pack": "*", // v1.0.5
"symfony/routing": "5.1.*", // v5.1.11
"symfony/twig-pack": "^1.0", // v1.0.1
"symfony/var-dumper": "5.0.*", // v5.0.11
"symfony/webpack-encore-bundle": "^1.7", // v1.8.0
"symfony/yaml": "5.0.*" // v5.0.11
},
"require-dev": {
"symfony/maker-bundle": "^1.15", // v1.23.0
"symfony/profiler-pack": "^1.0" // v1.0.5
}
}
2 Comments
Hey, I have a question regarding locale set in the services.yaml file.
parameters:
Does this in any way affect how datetime objects are handled by symfony, or is that purely determined by the server php setting?
It also seems like a browser will actually pass timezone information, because my server has been set to UTC, but when users in my timezone post a form with a date (from the html5 datepicker) it seems that the timezone comes in correctly. Don't know whether this is from the browser's datetime-picker or whether the application picks it up from the request headers locale?
Hey MattWelander!
Oh... timezones :p. I am far from an expert on these, but I believe that
DateTimeobjects create their timezone based on the php setting, independent of thelocaleparameter. I'm not aware of these two things playing together in any way, but I could be wrong.Hmm. Even if the locale were somehow picked up from a request header or something similar (this is possible - you could, for example, have some code that looks for the
Acceptlanguage header and calls$request->setLocale()based on this), that shouldn't affect the DateTime objects. My guess is that this info is being passed to your form someone from the Datepicker. I'd look closely at the raw POST parameters that are sent when you submit the form to see if the submitted datetime string has some sort of timezone in it.Sorry I can't give you more concrete answers - this isn't an area that I'm an expert in!
Cheers!
"Houston: no signs of life"
Start the conversation!