File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 1010namespace PHPFuse \Output ;
1111
1212use PHPFuse \Container \Interfaces \ContainerInterface ;
13- use Exception ;
13+ use Exception , BadMethodCallException ;
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
@@ -422,6 +422,26 @@ private function existAtGet(string $key): bool
422422 return (bool )(isset ($ this ->{$ key }) && $ this ->get === $ key );
423423 }
424424
425+ function dom (string $ key ): Document
426+ {
427+ return Document::dom ($ key );
428+ }
429+ function createTag (string $ element , string $ value , ?array $ attr = NULL ) {
430+ $ inst = new Document ();
431+ $ el = $ inst ->create ($ element , $ value )->attrArr ($ attr );
432+ return $ el ;
433+ }
434+
435+ function isDoc ($ el ): bool
436+ {
437+ return (bool )($ el instanceof Document || $ el instanceof Element);
438+ }
439+
440+ function isEl ($ el ): bool
441+ {
442+ return (bool )($ el instanceof Element);
443+ }
444+
425445 /*
426446 function dom(string $key): Document
427447 {
You can’t perform that action at this time.
0 commit comments