commit classe étudiant
This commit is contained in:
47
Etudiant.php
Normal file
47
Etudiant.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
class Etudiant {
|
||||
private $nom;
|
||||
private $prenom;
|
||||
private $age;
|
||||
|
||||
public function __construct(String $Nom, String $Prenom, int $Age) {
|
||||
$this->nom = $Nom;
|
||||
$this->prenom = $Prenom;
|
||||
$this->age = $Age;
|
||||
}
|
||||
|
||||
public function getNom() {
|
||||
return $this->nom;
|
||||
}
|
||||
|
||||
public function setNom($Nom) {
|
||||
$this->nom = $Nom;
|
||||
}
|
||||
|
||||
public function getPrenom() {
|
||||
return $this->prenom;
|
||||
}
|
||||
|
||||
public function setPrenom($Prenom) {
|
||||
$this->prenom = $Prenom;
|
||||
}
|
||||
|
||||
public function getAge() {
|
||||
return $this->age;
|
||||
}
|
||||
|
||||
public function setAge($Age) {
|
||||
$this->age = $Age;
|
||||
}
|
||||
|
||||
public function getEtudiant() {
|
||||
"<br/>";
|
||||
echo"infos étudiant : "."<br/>";
|
||||
echo"prenom étudiant : ".$this->getPrenom()."<br/>";
|
||||
echo"nom étudiant : ".$this->getNom()."<br/>";
|
||||
echo"age étudiant : ".$this->getAge()."<br/>";
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
include "script2.php";
|
||||
include "Etudiant.php";
|
||||
|
||||
echo "ICI SCRIPT 1 <br>";
|
||||
|
||||
$etudiant1 = new Etudiant("test","test",8);
|
||||
|
||||
echo $etudiant1->getEtudiant();
|
||||
|
Reference in New Issue
Block a user