Ich benutze Datepicker von Kartik. Ich benutze es mit Feldbereich und ich möchte eine Suchfunktion daraus machen. Aber ich kann keinen Wert erhalten oder Wert auf eine Variable davon speichern. Wie man es löst?Erhalten Wert von Datepicker in yii2
Dies ist der Code:
<?php
// With Range
$layout3 = <<< HTML
<span class="input-group-addon" style="background: #e9e9e6;">Tanggal Awal</span>
{input1}
<!--<span class="input-group-addon" style="background: #e9e9e6;">aft</span>
{separator}-->
<span class="input-group-addon" style="background: #e9e9e6;">Tanggal Akhir</span>
{input2}
<span class="input-group-addon kv-date-remove" style="background: #e9e9e6;">
<i class="glyphicon glyphicon-remove"></i>
</span>
HTML;
echo DatePicker::widget([
'type' => DatePicker::TYPE_RANGE,
'name' => 'dp_addon_3a',
'value' => date('Y-m-d'),
'name2' => 'dp_addon_3b',
'value2' => date('Y-m-d'),
// 'separator' => '<i class="glyphicon glyphicon-resize-horizontal"></i>',
'layout' => $layout3,
'pluginOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]);
$value = 'value';
$value2 = 'value2';
?>
Kann ich meine eigenen dateattribute machen? weil ich nur ein Attribut für das Datum habe. Wohingegen ich 2 Werte bekommen möchte. – RiefSapthana