Strict (2048): Declaration of BootstrapFormHelper::radio() should be compatible with FormHelper::radio($fieldName, $options = Array, $attributes = Array) [ROOT/plugins/TwitterBootstrap/View/Helper/BootstrapFormHelper.php, line 456]
/**
* Outputs a list of radio form elements with the proper
* markup for twitter bootstrap styles
*
* @param array $options
* @param array $attr
* @access public
* @return string
*/
public function radio($field, $options = array(), $attr = array()) {
if (is_array($field)) {
$options = $field;
} else {
$options["field"] = $field;
}
if (!isset($options["options"]) || !isset($options["field"])) {
return "";
}
$opt = $options["options"];
unset($options["options"]);
$inputs = "";
$attr['label'] = false;
$attr['hiddenField'] = (isset($options['hiddenField']) && $options['hiddenField']);
foreach ($opt as $key => $val) {
$input = parent::radio(
$options["field"],
array($key => $val),
$attr
);
$id = array();
preg_match_all("/id=\"[a-zA-Z0-9_-]*\"/", $input, $id);
if (!empty($id[0])) {
$id = end($id[0]);
$id = substr($id, 4);
$id = substr($id, 0, -1);
$input = $this->Html->tag(
"label",
$input,
array("class" => "radio", "for" => $id)
);
}
$inputs .= $input;
}
$options["input"] = $inputs;
return $this->input($options);
}
Error Message:
Strict (2048): Declaration of BootstrapFormHelper::radio() should be compatible with FormHelper::radio($fieldName, $options = Array, $attributes = Array) [ROOT/plugins/TwitterBootstrap/View/Helper/BootstrapFormHelper.php, line 456]
Solution: