/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { $modelSensor = new Sensor(); $modelSensor->setScenario('buscar'); $model = null; $idSensor = null; if (isset($_POST['Sensor'])) { $modelSensor->attributes = $_POST['Sensor']; if ($modelSensor->validate()) { $model = Sensor::model()->getSensorValores($modelSensor->idsensor); $idSensor = $modelSensor->idsensor; } } $this->render('index', array('model' => $model, 'modelSensor' => $modelSensor, 'idSensor' => $idSensor)); }