コード例 #1
0
 /**
  * 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 $id the ID of the model to be loaded
  * @return CategoriesMajors the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = CategoriesMajors::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
コード例 #2
0
ファイル: _form.php プロジェクト: argenis1763/vc
  ); */
?>
  
			
		<p>Colleges <span class="required">*</span></p>
		<?php 
$Options = array();
foreach ($model->colleges as $colleges) {
    $Options[$colleges->id] = array('selected' => 'selected');
}
$form->widget('yiiwheels.widgets.multiselect.WhMultiSelect', array('name' => 'colleges', 'data' => CHtml::listData(Colleges::model()->findAll(array('order' => 'name ASC')), 'id', 'name'), 'pluginOptions' => array('includeSelectAllOption' => false, 'enableFiltering' => true, 'enableCaseInsensitiveFiltering' => true, 'buttonWidth' => '300', 'maxHeight' => '300'), 'htmlOptions' => array('options' => $Options)));
?>
 
		<br />
		<br />
		
        <?php 
echo $form->dropDownListControlGroup($model, 'categories_majors_id', CHtml::listData(CategoriesMajors::model()->findAll(array('order' => 'name ASC')), 'id', 'name'));
?>
    

        <?php 
echo $form->textAreaControlGroup($model, 'description', array('span' => 6, 'rows' => 10, 'maxlength' => 11000));
?>
      </fieldset> 
        <?php 
echo TbHtml::formActions(array(TbHtml::submitButton($model->isNewRecord ? 'Procesar' : 'Guardar', array('color' => TbHtml::BUTTON_COLOR_PRIMARY))));
?>

<?php 
$this->endWidget();