/**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Scene::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #2
0
?>
    </div>

    <div class="row"> 
        <?php 
echo $form->checkBoxListInlineRow($model, 'tbl_schedule_recurring', array('Sun' => 'Sun', 'Mon' => 'Mon', 'Tue' => 'Tue', 'Wed' => 'Wed', 'Thu' => 'Thu', 'Fri' => 'Fri', 'Sat' => 'Sat'));
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'tbl_scenes_idtbl_scene');
?>
        
        <?php 
$models = Scene::model()->findAll(array('order' => 'tbl_scene_title'));
$list = CHtml::listData($models, 'idtbl_scene', 'tbl_scene_title');
echo CHtml::dropDownList('Scheduler[tbl_scenes_idtbl_scene]', $model->tbl_scenes_idtbl_scene, $list);
?>
        <?php 
echo $form->error($model, 'tbl_scenes_idtbl_scene');
?>
    </div>

    <div class="row buttons">
        <?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
    </div>

    <?php