File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -73,18 +73,23 @@ class ReportContainer extends WidgetBase
73
73
/**
74
74
* Constructor.
75
75
*/
76
- public function __construct ($ controller )
76
+ public function __construct ($ controller, $ configuration = null )
77
77
{
78
- $ configFile = 'config_ ' . snake_case ($ this ->alias ) . '.yaml ' ;
79
- $ path = $ controller ->getConfigPath ($ configFile );
80
- if (File::isFile ($ path )) {
81
- $ config = $ this ->makeConfig ($ configFile );
78
+ if (!$ configuration ) {
79
+ $ configuration = 'config_report_container.yaml ' ;
82
80
}
83
- else {
84
- $ config = [];
81
+
82
+ if (!is_array ($ configuration )) {
83
+ $ path = $ controller ->getConfigPath ($ configuration );
84
+ if (File::isFile ($ path )) {
85
+ $ configuration = $ this ->makeConfig ($ path );
86
+ }
87
+ else {
88
+ $ configuration = [];
89
+ }
85
90
}
86
91
87
- parent ::__construct ($ controller , $ config );
92
+ parent ::__construct ($ controller , $ configuration );
88
93
89
94
$ this ->bindToController ();
90
95
$ this ->fillFromConfig ();
You can’t perform that action at this time.
0 commit comments