public function indexAction()
 {
     $datos = InitUser::inicializarPropiedades();
     $em = new UserEntityManager();
     $elements = $em->findAll();
     $datos->setElements($elements);
     View::set('datos', $datos);
     View::render("crud/select");
 }
Example #2
0
 public function Login($request)
 {
     $formUser = $request->user;
     $user = $formUser;
     $em = new UserEntityManager();
     $user = $em->login($user);
     if (isset($user)) {
         $user->setPass(null);
         $output = $user->getJson();
     } else {
         $output = json_encode(array('error' => array('error' => 'login error', 'cod' => 1)));
     }
     $response = null;
     header('Content-Type: application/x-json');
     $response = $output;
     echo $response;
 }