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

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

parents 60afe753 dcaf89a0
No related branches found
No related tags found
No related merge requests found
<?php
class GenderField extends Field
{
public function html() {
// Todo, if isset($_POST[$this->name]) && !$this->validate() => Show a error msg explanation for this line.
$html = '<div class="form-group">
<label for="form'.$this->name.'">'.$this->label.'</label>
<select class="form-control" name="'.$this->name.'">';'
<option value="M" selected>Male</option>
<option value="F">Femelle</option>
</select>
</div>';
return $html;
}
public function validate()
{
$this->value = $_POST[$this->name];
return true;
}
public function show() {
if ($this->value == 'M') {
$html = 'Male';
} else {
$html = 'Femelle';
}
return $html;
}
}
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