Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/02/2012, 00:51
Avatar de repara2
repara2
 
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 14 años, 5 meses
Puntos: 331
Respuesta: Pasar variables de funciones

Tu código no funcionaría, supongo que te refieres a esto:

Código PHP:
Ver original
  1. class Algo{
  2.    
  3.     var $msg = "";
  4.  
  5.     public function __construct(){}
  6.     public function __destruct(){}
  7.  
  8.     public function hola()
  9.     {
  10.         $this->msg  = "Esta variable es de ambito global"; ///Quiero pasar esta variable a otro metodo
  11.     }
  12.  
  13.     public function adios()
  14.     {
  15.         return $this->hola();
  16.     }
  17.  
  18. }

Salu2!!
__________________
Fere libenter homines, id quod volunt, credunt.