<?php
use yii\helpers\ArrayHelper;

use common\modules\school\models\Courses;
use common\modules\testings\models\Test;

$elements = [
    'test_id' => ['type' => 'dropdownlist', 'items' => ArrayHelper::map(Test::find()->all(), 'id', 'name', 'session.name'), 'empty' => 'Не задан'],
    'title'	=> ['type' => 'text'],
    'video_id'	=> ['type' => 'text'],
    'text' => ['type' => 'textarea'],
    'course_id' => [
            'type' => 'dropdownlist',
            'items' => ArrayHelper::map(Courses::find()->all(), 'id', 'title'),
        ],
    'number'	=> ['type' => 'text'],
];

return [
    'activeForm'=>[
        'id' => 'lesson-form',
    ],
    'elements'       => $elements,
    'buttons' => [
        'submit' => ['type' => 'submit', 'value' => 'Cохранить']
    ]
];

