Ecco il form :
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\jui\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\Film */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="film-form">
<?php
$id=Yii::$app->user->identity->id;
$t=time();
$data=date("Y-m-d-G-i-s",$t);
?>
<?php $form = ActiveForm::begin(); ?>
<div class="row">
<div class="col-md-6">
<?= $form->field($model, 'nome')->textInput(['maxlength' => 50]) ?>
<?= Html::activeHiddenInput($model,'utente',array('value'=>$id))?>
<?= $form->field($model, 'trailer')->textInput(['maxlength' => 300]) ?>
<?= $form->field($model, 'mymovies')->textInput(['maxlength' => 300]) ?>
<?/*= DatePicker::widget([
'model' => $model,
'attribute' => 'data',
'language' => 'it',
'dateFormat' => 'yyyy-MM-dd',
]); */?>
<?= $form->field($model,'data')->widget(DatePicker::className(),['clientOptions' => ['defaultDate' => '1990-01-01']]) ?>
<?= Html::activeHiddenInput($model,'data_ins',array('value'=>$data)) ?>
<?= $form->field($model, 'q_video')->dropDownList(
['1'=>'1',
'2'=>'2',
'3'=>'3',
'4'=>'4',
'5'=>'5',
'6'=>'6',
'7'=>'7',
'8'=>'8',
'9'=>'9',
'10'=>'10',]
); ?>
<?= $form->field($model, 'q_audio')->dropDownList(
['1'=>'1',
'2'=>'2',
'3'=>'3',
'4'=>'4',
'5'=>'5',
'6'=>'6',
'7'=>'7',
'8'=>'8',
'9'=>'9',
'10'=>'10',]
); ?>
</div>
<div class="row">
<div class="col-md-6">
<?= $form->field($model, 'copertina')->textInput(['maxlength' => 300]) ?>
<?= $form->field($model, 'genere')
->dropDownList(
['Animazione'=>'Animazione',
'Avventura'=>'Avventura',
'Azione'=>'Azione',
'Balletto'=>'Balletto',
'Biografico'=>'Biografico',
'Commedia'=>'Commedia',
'Documentario'=>'Documentario',
'Drammatico'=>'Drammatico',
'Epico'=>'Epico',
'Erotico'=>'Erotico',
'Fantascienza'=>'Fantascienza',
'Giallo'=>'Giallo',
'Guerra'=>'Guerra',
'Horror'=>'Horror',
'Musical'=>'Musical',
'Noir'=>'Noir',
'Spionaggio'=>'Spionaggio',
'Storico'=>'Storico',
'Thriller'=>'Thriller',
'Western'=>'Western',]
); ?>
<?= $form->field($model, 'durata')->textInput() ?>
<?= Html::activeHiddenInput($model,'data_ins',array('value'=>$data)) ?>
<?= $form->field($model, 'trama')->textarea(['rows' => 6]) ?>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h2>Sezione riservata al download</h2>
<?= $form->field($model, 'nome_link1')->textInput(['maxlength' => 20]) ?>
<?= $form->field($model, 'link1')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link1b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link1c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link1d')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'nome_link2')->textInput(['maxlength' => 20]) ?>
<?= $form->field($model, 'link2')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link2b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link2c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link2d')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'nome_link3')->textInput(['maxlength' => 20]) ?>
<?= $form->field($model, 'link3')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link3b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link3c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link3d')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'nome_link4')->textInput(['maxlength' => 20]) ?>
<?= $form->field($model, 'link4')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link4b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link4c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link4d')->textInput(['maxlength' => 100]) ?>
</div>
<div class="col-md-6">
<h2>Sezione riservata allo streaming</h2>
<?= $form->field($model, 'nome_link5')->textInput(['maxlength' => 20]) ?>
<?= $form->field($model, 'link5')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link5b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link5c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link5d')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'nome_link6')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link6')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link6b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link6c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link6d')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'nome_link7')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link7')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link7b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link7c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link7d')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'nome_link8')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link8')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link8b')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link8c')->textInput(['maxlength' => 100]) ?>
<?= $form->field($model, 'link8d')->textInput(['maxlength' => 100]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Inserisci Film' : 'Modifica Film', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>