Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/07/2007, 12:18
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: Objeto dentro de una clase

Código PHP:
<?
class Clase1
{
       private 
$obj;

       public function 
funcion()
      {
           
$this->obj->metodo();
       }

      public function 
__construct($aux)
      {
           if( !
$aux ) {
                 
$this->obj = new Clase2();
           } else {
                 
$this->obj $aux;
           }
      }
}
?>
Saludos.