Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Laravel Weekly #23 - Quick Tip
<?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');
@msurguy

This comment has been minimized.

Copy link

commented Sep 13, 2013

Cool snippet =)

@louposk

This comment has been minimized.

Copy link

commented Sep 16, 2013

Great!

@ghost

This comment has been minimized.

Copy link

commented Sep 16, 2013

thank you!

@Jaspur

This comment has been minimized.

Copy link

commented Sep 21, 2013

What about translations for the months? There is the setlocale() for in PHP, but where to set it correctly?

@driesvints

This comment has been minimized.

Copy link
Owner Author

commented Sep 24, 2013

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.

@JosephSilber

This comment has been minimized.

Copy link

commented Sep 24, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.