Skip to content
Snippets Groups Projects
Commit d8615440 authored by clement's avatar clement
Browse files

Merge branch 'master' of gitlab.utc.fr:nf17-camp-p14/clivi

parents 42c1f06a 7b7edc15
No related branches found
No related tags found
No related merge requests found
<?php
class Form {
protected $object;
public function __construct() {
}
public function setObject(&$obj) {
$this->object =& $obj;
}
public function getTitle() {
return "Ajouter un ".get_class($this->object);
}
}
\ No newline at end of file
......@@ -30,4 +30,11 @@ class Objet
return $result;
}
public function getForm()
{
$form = new Form();
$form->setObject($this);
return $form;
}
}
\ No newline at end of file
......@@ -25,10 +25,14 @@ switch($action) {
include 'view/list.php';
break;
case "addPersonnel":
$employe = new Employe();
$formConf = $employe->getForm();
include 'view/form.php';
break;
case "addClient":
$client = new Client();
$formConf = $client->getForm();
include 'view/form.php';
break;
default:
include 'view/404.php';
......
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1><?php echo $formConf->getTitle(); ?></h1>
</div>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment