File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 1414
1515use PHPFuse \DTO \Format \Str ;
1616use PHPFuse \DTO \Traverse ;
17- use PHPFuse \Output \Dom \Document ;
18- use PHPFuse \Output \Dom \Element ;
17+ // use PHPFuse\Output\Dom\Document;
18+ // use PHPFuse\Output\Dom\Element;
1919
2020class SwiftRender {
2121
@@ -43,6 +43,23 @@ function __construct() {
4343
4444 }
4545
46+
47+ /**
48+ * This will make shortcuts to container.
49+ * @param string $m [description]
50+ * @param string $a [description]
51+ * @return ContainerInterface
52+ */
53+ function __call ($ m , $ a ) {
54+ if (!is_null ($ this ->container )) {
55+ if ($ this ->container ->has ($ m )) {
56+ return $ this ->container ->get ($ m , $ a );
57+ } else {
58+ throw new BadMethodCallException ('The method " ' .$ m .'" does not exist in the Container or the Class " ' .static ::class.'"! ' , 1 );
59+ }
60+ }
61+ }
62+
4663 /**
4764 * Pass a container class instance of ContainerInterface, that can be used with in your templates
4865 * @param ContainerInterface $container
You can’t perform that action at this time.
0 commit comments