I have this error in this code, I use the same structure of PHP - extend method like extending a class , what is the problem?
abstract class lidacomentradas
{public $texto;
function __construct($entrada) {
$this->texto = $entrada;
}
abstract public function normalizaMyWay();
public function normaliza() {
$this->texto = str_replace("'",'"',$this->texto);
$this->texto = preg_replace("/[():]/", "", $this->texto);
$this->texto = NormalizaEspacos($this->texto );
normalizaMyWay();
}
}
class titulo extends lidacomentradas {
public function normalizaMyWay(){;}
public function criaUrl(){
return str_replace(" ","_",(strtolower(LimpaTexto($this->texto))));
}
}
class corpo extends lidacomentradas {
public function normalizaMyWay() {
$lixo=strpos("Esta notícia foi acessada",$this->texto);
if ($lixo<>0) {$this->texto= substr($this->texto,0,$lixo);}
}
}
I think the problem is in your nomaliza
method in abstract class lidacomentradas
.
The calling of method should be $this->normalizaMyWay();
not as function normalizaMyWay();