create_js_button改为多参数支持

This commit is contained in:
hyzboy 2017-02-16 10:41:11 +08:00
parent 471b7f2c15
commit d211ee3dba

View File

@ -53,8 +53,17 @@
} }
};//class UIButton };//class UIButton
function create_js_button($text,$js_func) //function create_js_button($text,$js_func,$style)
function create_js_button()
{ {
echo '<button type="button" onclick="'.$js_func.'" class="btn btn-primary">'.$text.'</button>'; $text=func_get_arg(0);
$js_func=func_get_arg(1);
if(func_num_args()>2)
$style=func_get_arg(2);
else
$style="primary";
echo '<button type="button" onclick="'.$js_func.'" class="btn btn-'.$style.'">'.$text.'</button>';
} }
?> ?>