/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Menus();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     $videos = VideoImg::getVideos();
     if (isset($_POST['Menus'])) {
         $model->attributes = $_POST['Menus'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model, 'videos' => $videos));
 }
예제 #2
0
?>
                        </div>
                    </div>

                    <div class="row top">
                        <div class="col-md-3">
                            <?php 
echo $form->labelEx($model, 'video');
?>
                            <?php 
// echo $form->textField($model, 'video');
?>
                        </div>
                        <div class="col-md-9">
                            <?php 
echo $form->dropDownList($model, 'video', VideoImg::getVideos(), array('empty' => 'Select'), array('options' => array($model->video => array('selected' => true))));
?>
                            <?php 
echo $form->error($model, 'video');
?>
                        </div>
                    </div>

                    <div class="row top buttons">
                        <div class="col-md-3">
                        </div>
                        <div class="col-md-9">
                            <?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Submit', array('class' => 'btn btn-primary '));
?>
                        </div>