Skip to content

Commit 2abe751

Browse files
committed
add startwith check to action method. fix #r343942724
1 parent d95bac8 commit 2abe751

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Html/Button.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ public function actionSubmit()
185185
*/
186186
public function action($value)
187187
{
188-
$this->attributes['action'] = "function(e, dt, node, config) { $value }";
188+
if (substring($value, 0, 8) == 'function') {
189+
$this->attributes['action'] = $value;
190+
} else {
191+
$this->attributes['action'] = "function(e, dt, node, config) { $value }";
192+
}
189193

190194
return $this;
191195
}

0 commit comments

Comments
 (0)