Exemplo n.º 1
0
 public static function _displayPagina($accion)
 {
     $colorCookie = new Color();
     if ($accion == "probarColor") {
         $colorCookie->probarColor();
         self::$_estilo = $colorCookie->getEstilo();
     } else {
         $colorCookie->ponerColor();
         self::$_enlacesColores = "Cambio de color: <a href='index.php?color=rojo'>Rojo</a>\n<a href='index.php?color=azul'>Azul</a>\n<a href='index.php?color=verde'>Verde</a>\n<a href='index.php?color=ninguno'>Ninguno</a>";
         self::$_enlace = "<a href='index.php?accion=probarColor'>Comprobar la cookie</a>";
     }
     self::$_color = $colorCookie->getColor();
     if (isset($_COOKIE["cookieColor"]) && self::$_color != "ninguno") {
         self::$_mensaje = "Se ha elegido el color " . self::$_color;
     } else {
         self::$_mensaje = "No se ha elegido color";
     }
     self::$_operacion = $colorCookie->getOperacion();
     self::_retornarVista();
 }
Exemplo n.º 2
0
 public function run()
 {
     encuestaVista::_displayPagina();
 }