public function addButton($name, $value, $type = 'submit', $class = null)
{
$name = (string) $name;
$value = (string) $value;
$type = (string) $type;
$class = $class !== null ? (string) $class : 'btn btn-primary';
// do a check
if ($type == 'submit' && $name == 'submit') {
throw new Exception('You can\'t add buttons with the name submit. JS freaks out when we
replace the buttons with a link and use that link to submit the form.');
}
// create and return a button
return parent::addButton($name, $value, $type, $class);
}