Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/01/2013, 14:11
Avatar de andy98
andy98
 
Fecha de Ingreso: diciembre-2011
Mensajes: 32
Antigüedad: 12 años, 4 meses
Puntos: 2
Pregunta Call to undefined method

Hola,

Tengo esta clase:

class Usuario
{
public function __construct(){}

public function Agente(){
return $this->_esAgente();
}

private function _esAgente() {
$booleano = FALSE;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Googlebot')!==FALSE) {
$booleano = TRUE;
} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Bingbot')!==FALSE) {
$booleano = TRUE;
}

$retorno = ($booleano ? 'true' : 'false');

return $retorno;
}
}
}

despues pongo:

require_once("../php/Usuario.php");
$usuario = new Usuario();

$robot = $usuario->Agente();

Pues en esta última linea me da el error fatal del título.