File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,15 @@ abstract class Widget extends HtmlDoubleElement {
65
65
protected $ _runned ;
66
66
67
67
protected $ _hasRules ;
68
-
68
+
69
69
public function __construct ($ identifier , $ model , $ modelInstance = NULL ) {
70
70
parent ::__construct ($ identifier );
71
71
$ this ->_template = "%wrapContentBefore%%content%%wrapContentAfter% " ;
72
72
$ this ->setModel ($ model );
73
73
if (isset ($ modelInstance )) {
74
- $ this ->_model =get_class ($ modelInstance );
74
+ if (\is_object ($ modelInstance )) {
75
+ $ this ->_model = \get_class ($ modelInstance );
76
+ }
75
77
$ this ->show ($ modelInstance );
76
78
}
77
79
$ this ->_generated = false ;
@@ -481,7 +483,7 @@ protected function _compileForm() {
481
483
$ noValidate = "" ;
482
484
if (\sizeof ($ this ->_form ->getValidationParams ()) > 0 )
483
485
$ noValidate = "novalidate " ;
484
- $ this ->wrapContent ("<form class=' " . $ this ->_form ->getProperty ('class ' ). "' id='frm- " . $ this ->identifier . "' name='frm- " . $ this ->identifier . "' " . $ noValidate . "> " , "</form> " );
486
+ $ this ->wrapContent ("<form class=' " . $ this ->_form ->getProperty ('class ' ) . "' id='frm- " . $ this ->identifier . "' name='frm- " . $ this ->identifier . "' " . $ noValidate . "> " , "</form> " );
485
487
}
486
488
}
487
489
@@ -544,5 +546,4 @@ public function getModelInstance() {
544
546
public function hasRules () {
545
547
return $ this ->_hasRules ;
546
548
}
547
-
548
549
}
You can’t perform that action at this time.
0 commit comments