File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 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 {
6565 protected $ _runned ;
6666
6767 protected $ _hasRules ;
68-
68+
6969 public function __construct ($ identifier , $ model , $ modelInstance = NULL ) {
7070 parent ::__construct ($ identifier );
7171 $ this ->_template = "%wrapContentBefore%%content%%wrapContentAfter% " ;
7272 $ this ->setModel ($ model );
7373 if (isset ($ modelInstance )) {
74- $ this ->_model =get_class ($ modelInstance );
74+ if (\is_object ($ modelInstance )) {
75+ $ this ->_model = \get_class ($ modelInstance );
76+ }
7577 $ this ->show ($ modelInstance );
7678 }
7779 $ this ->_generated = false ;
@@ -481,7 +483,7 @@ protected function _compileForm() {
481483 $ noValidate = "" ;
482484 if (\sizeof ($ this ->_form ->getValidationParams ()) > 0 )
483485 $ 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> " );
485487 }
486488 }
487489
@@ -544,5 +546,4 @@ public function getModelInstance() {
544546 public function hasRules () {
545547 return $ this ->_hasRules ;
546548 }
547-
548549}
You can’t perform that action at this time.
0 commit comments