Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/04/2010, 09:49
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
Respuesta: Parámetros por defecto dentro de clases

Código PHP:
Ver original
  1. class foo {
  2.          private $_default = "default";
  3.    
  4.          public function baz($bar, $foo=null)
  5.          {
  6.                 if ($foo == null) {
  7.                        $foo = $this->_default;
  8.                 }
  9.  
  10.                 //...
  11.          }
  12. }

Saludos.