Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created September 12, 2012 09:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/3705417 to your computer and use it in GitHub Desktop.
Save bakura10/3705417 to your computer and use it in GitHub Desktop.
DateSelect element for ZF 2
$this->add(array(
'type' => 'Zend\Form\Element\DateSelect',
'name' => 'birthDate',
'options' => array(
'label' => 'Date de naissance',
'create_empty_option' => true,
'min_year' => date('Y') - 30,
'max_year' => date('Y') - 18,
'day_attributes' => array(
'data-placeholder' => 'Jour',
'style' => 'width: 20%'
),
'month_attributes' => array(
'data-placeholder' => 'Mois',
'style' => 'width: 20%'
),
'year_attributes' => array(
'data-placeholder' => 'Année',
'style' => 'width: 20%'
)
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment