@@ -35,6 +35,7 @@ public function __construct(
35
35
private EventDispatcherInterface $ eventDispatcher ,
36
36
private array $ config ,
37
37
private Environment $ environment ,
38
+ private string $ twigExtension
38
39
) {
39
40
}
40
41
@@ -48,7 +49,7 @@ public function metadataFor(string $name): ComponentMetadata
48
49
]);
49
50
}
50
51
51
- throw new \InvalidArgumentException (sprintf ('Unknown component "%s". The registered components are: %s ' , $ name , implode (', ' , array_keys ($ this ->config ))));
52
+ throw new \InvalidArgumentException (sprintf ('Unknown component "%s". The registered components are: %s. And no template %s. founded ' , $ name , implode (', ' , array_keys ($ this ->config )), $ this -> getTemplateFromName ( $ name )));
52
53
}
53
54
54
55
return new ComponentMetadata ($ config );
@@ -156,7 +157,7 @@ private function getComponent(string $name): object
156
157
return new StaticComponent ();
157
158
}
158
159
159
- throw new \InvalidArgumentException (sprintf ('Unknown component "%s". The registered components are: %s ' , $ name , implode (', ' , array_keys ($ this ->components ->getProvidedServices ()))));
160
+ throw new \InvalidArgumentException (sprintf ('Unknown component "%s". The registered components are: %s. And no template %s. founded ' , $ name , implode (', ' , array_keys ($ this ->components ->getProvidedServices ())), $ this -> getTemplateFromName ( $ name )));
160
161
}
161
162
162
163
return $ this ->components ->get ($ name );
@@ -203,6 +204,6 @@ private function isStaticComponent(string $name): bool
203
204
204
205
private function getTemplateFromName (string $ name ): string
205
206
{
206
- return str_replace ('. ' , '/ ' , $ name ).' .html.twig ' ;
207
+ return str_replace ('. ' , '/ ' , $ name ).$ this -> twigExtension ;
207
208
}
208
209
}
0 commit comments