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

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

parents 12748ba2 7a02c6ea
Branches
No related tags found
No related merge requests found
<?
class BoolField extends Field
{
public function html() {
$html = '<div class = "form-group">
<label for = "form'.$this->name.'">'.ucfirst($this->name).'</label>
<input type = "checkbox" class="form-control" name = "'.$this->name.'" value ="'.$this->value.'">
</div>';
return $html;
}
public function validate()
{
$this->value = $POST[$this->name];
if (!is_bool($this->value))
return false;
return true;
}
}
...@@ -26,20 +26,3 @@ class Field { ...@@ -26,20 +26,3 @@ class Field {
} }
} }
class BoolField extends Field
{
public function __construct($name, &$value)
{
parent::__construct($name, &$value);
}
public function validate()
{
$this->value = $POST[$this->name];
if (!is_bool($this->value))
return false;
return true;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment