/** * Manages all models. */ public function actionAdmin() { $model = new Clipro('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Clipro'])) { $model->attributes = $_GET['Clipro']; } if (isset($_GET['espe'])) { // $this->render('ju',array('data'=>$model->search()->getdata())); $modelito = new Clipro('search_'); $modelito->unsetAttributes(); // clear any default values if (isset($_GET['Clipro'])) { $modelito->attributes = $_GET['Clipro']; } $data = $modelito->search_()->getdata(); Yii::import('application.extensions.phpexcel.JPhpExcel'); $xls = new JPhpExcel('UTF-8', false, 'My Test Sheet'); $xls->addArray($data); $xls->generateXML('my-test'); Yii::app()->end(); } $this->render('admin', array('model' => $model)); }