/**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $this->layout = 'sitio';
     $especialidades = CHtml::listData(Especialidad::model()->findAll(), 'especialidad_id', 'especialidad_nombre');
     $buscarProfesionalApellidoModel = new BuscarProfesionalApellido();
     $buscarProfesionalEspecialidadModel = new BuscarProfesionalEspecialidad();
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $this->render('index', array('buscarProfesionalApellidoModel' => $buscarProfesionalApellidoModel, 'buscarProfesionalEspecialidadModel' => $buscarProfesionalEspecialidadModel, 'especialidades' => $especialidades));
 }
 /**
  * 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 Especialidad the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Especialidad::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #3
0
echo $form->labelEx($model, 'email');
?>
		<?php 
echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 100));
?>
		<?php 
echo $form->error($model, 'email');
?>
	</div>

	<div class="span2">
		<?php 
echo $form->labelEx($model, 'especialidad_id');
?>
		<?php 
echo $form->dropDownList($model, 'especialidad_id', CHtml::listData(Especialidad::model()->findAll(), 'id', 'nombre'), array('prompt' => 'Seleccione Especialidad'));
?>
		<?php 
echo $form->error($model, 'especialidad_id');
?>
	</div>
        
<div class="clearfix"></div>
<br/>
	<div class="span2">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Guardar', array('class' => 'btn'));
?>
	</div>
<br/>