Premier commit
This commit is contained in:
44
Etudiant.php
Normal file
44
Etudiant.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
Class Etudiant{
|
||||
|
||||
private $nom;
|
||||
private $prenom;
|
||||
private $age;
|
||||
|
||||
public function __construct($nom,$prenom,$age){
|
||||
$this->nom = $nom;
|
||||
$this->prenom = $prenom;
|
||||
$this->age = $age;
|
||||
}
|
||||
|
||||
public function afficherHtml(){
|
||||
echo "Etudiant2 :<br>". "Nom : ".$this->getNom()."<br>"
|
||||
."Prenom : ".$this->getPrenom()."<br>"."Age : ".$this->getAge()."<br>";
|
||||
}
|
||||
|
||||
//accès en écriture (setter)
|
||||
public function setNom($nom){
|
||||
$this->nom = $nom;
|
||||
}
|
||||
|
||||
public function setPrenom($prenom){
|
||||
$this->prenom = $prenom;
|
||||
}
|
||||
|
||||
public function setAge($age){
|
||||
$this->age = $age;
|
||||
}
|
||||
|
||||
public function getNom(){
|
||||
return $this->nom;
|
||||
}
|
||||
|
||||
public function getPrenom(){
|
||||
return $this->prenom;
|
||||
}
|
||||
|
||||
public function getAge(){
|
||||
return $this->age;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user