So, I'm very new to PHP and my former experience was with Java.
What I would like to know is if it's possible to make a interface with methods that ask information, threat the information sent and return something.
For clarifying a little I'm trying to do something like this:
Code: Select all
class Interfaces {
public function getCar() {
$result = "<form name=\"cadCar\">
<h1>Car inclusion<h1>
<p><b>Model: </b>
<input type=\"text\" name=\"vM\" size=40 maxlength=80>
</p>
<p><b>Color: </b>
<input type=\"text\" name=\"vC\" size=30 maxlength=40>
</p>
<p><b>Year: </b>
<input type=\"text\" name=\"vA\" size=30 maxlength=20>
</p>
<p><b>ID: </b>
<input type=\"text\" name=\"vID\" size=30 maxlength=20>
</p>
<right><input type=\"submit\" value=\"Inclui\"></right> ";
echo $result;
return new Car($vM, $vC, $vA, $vID);
}
}Code: Select all
require("Car.php");
require("List.php");
require("Interfaces.php");
$l1 = new List();
$i1 = new Interfaces();
$c1 = $i1->getCar();
$l1->addCar($c1);