I am trying to create a class with a constructor
but it is returning me this error. I tried to do something similar to Java since I do not program in PHP
yet, but it is returning this error:
Notice: Undefined variable: typegraph in C: \ inetpub \ wwwroot \ HOPE \ php \ graphics.php on line 23
I have tried to use the methods GETTERS
and SETTERS
and even then I could not solve it.
class Grafico{
private $typegraph=0;
private $graphTitle=0;
private $HorizontalTitle=0;
private $sufixo=0;
private $lineName=0;
private $valuesdescription=0;
private $values=0;
public function Grafico($typegraph_p, $graphTitle_p, $HorizontalTitle_p, $sufixo_p, $lineName_p, $valuesdescription_p, $values_p){
$typegraph = $typegraph_p;
$graphTitle = $graphTitle_p;
$HorizontalTitle = $HorizontalTitle_p;
$sufixo = $sufixo_p;
$lineName = $lineName_p;
$valuesdescription = $valuesdescription_p;
$values = $values_p;
}
public function Printa(){
echo $typegraph;
echo $graphTitle;
echo $HorizontalTitle;
echo $sufixo;
echo $lineName;
echo $valuesdescription;
echo $values;
}
}