Last active
October 23, 2018 07:52
-
-
Save driesvints/6543470 to your computer and use it in GitHub Desktop.
Laravel Weekly #23 - Quick Tip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Create a list with numbers ranging from 10 to 20. | |
Form::selectRange('number', 10, 20); | |
# Create a list with years ranging from 1900 to 2000. | |
Form::selectYear('year', 1900, 2000); | |
# Creates a list with month names. | |
Form::selectMonth('month'); |
thank you!
What about translations for the months? There is the setlocale()
for in PHP, but where to set it correctly?
The month names are generated with the strftime
function and should respect the app's locale settings.
You can set the locale in Laravel through the App::setLocale($lang)
function. Check the localization docs for more info.
Can anybody explain this to me?
What's the difference between the selectRange
& selectYear
methods?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great!