Dynamic Form with a single model

I have this Model Class

CentreProgramme




        public function attributeLabels()

    {

        return [

            'id' => Yii::t('centre', 'ID'),

            'state_office_id' => Yii::t('centre', 'State Office'),

            'study_centre_id' => Yii::t('centre', 'Study Centre'),

            'programme_id' => Yii::t('centre', 'Programme'),

        ];

    }



7679

dynamicform.PNG

I have always worked with Dynamic Form that saved in multiple models, especially wbraganca. However, I want to create a Dynamic Form whereby everything will be saved on the same Model Class, CentreProgramme. When the Add button is clicked, Dropdownlist with attribute Programme_id will be created.

How do I achieve this. Thanks

in the form Arrays can be used. like attribute_name[]