public function getSearchEtapasAction() { $user = $this->get('security.context')->getToken()->getUser(); $entId = null; if ($user->getEntidad() != null) { $entId = $user->getEntidad()->getEntId(); } $solImportacionDao = new SolImportacionDao($this->getDoctrine()); $registros = $solImportacionDao->getSearchEtapas($entId); $numfilas = count($registros); $htmlResponse = '<select>'; if ($numfilas != 0) { $i = 0; foreach ($registros as $reg) { if ($i == 0) { $htmlResponse = $htmlResponse . "<option value='' >Seleccione</option>"; } $htmlResponse = $htmlResponse . "<option value='" . $reg['etpNombre'] . "' >" . $reg['etpNombre'] . "</option>"; $i++; } if ($i == 0) { $htmlResponse = $htmlResponse . '<option value="">No existen registros</option>'; } } else { $htmlResponse = $htmlResponse . '<option value="">No existen registros</option>'; } $htmlResponse = $htmlResponse . '</select>'; $response = new Response($htmlResponse); return $response; }