I'm using form helper to input date select as follows
echo $this->Form->date('date_from', [
'empty' => [
'year' => 'Choose Year',
'month' => 'Choose Month',
'day' => 'Choose Date'
],
'label' => 'Date From'
]);
But this is only showing select field and not the label Date From
It looks like CakePHP3 form helper with date
doesn't support label
as parameter.
But this will generate exactly the same label as you want:
<?php
echo $this->Form->label('Date From');
echo $this->Form->date('date_from', [
'empty' => [
'year' => 'Choose Year',
'month' => 'Choose Month',
'day' => 'Choose Date'
],
]);
?>
See here: Creating label in CakePHP3 form helper.