Browse code

Add contao js template and add plugin and bundle configuration classes

Benjamin Roth authored on25/05/2023 09:48:21
Showing3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,4 @@
1
+<?php
2
+use Contao\Template;
3
+echo Template::generateScriptTag('bundles/vonrotenberghtmx/htmx.min.js',false,null);
4
+?>
0 5
\ No newline at end of file
1 6
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
+
5
+/*
6
+ * This file is part of HTMX bundle for Contao.
7
+ *
8
+ * (c) Benjamin Roth
9
+ *
10
+ * @license LGPL-3.0-or-later
11
+ */
12
+
13
+namespace vonRotenberg\HtmxBundle\ContaoManager;
14
+
15
+use Contao\CoreBundle\ContaoCoreBundle;
16
+use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
17
+use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
18
+use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
19
+use vonRotenberg\JboxBundle\VonrotenbergJboxBundle;
20
+
21
+class Plugin implements BundlePluginInterface
22
+{
23
+    public function getBundles(ParserInterface $parser): array
24
+    {
25
+        return [
26
+            BundleConfig::create(VonrotenbergHtmxBundle::class)
27
+                ->setLoadAfter([ContaoCoreBundle::class]),
28
+        ];
29
+    }
30
+}
0 31
new file mode 100644
... ...
@@ -0,0 +1,23 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
+
5
+/*
6
+ * This file is part of HTMX bundle for Contao.
7
+ *
8
+ * (c) Benjamin Roth
9
+ *
10
+ * @license LGPL-3.0-or-later
11
+ */
12
+
13
+namespace vonRotenberg\HtmxBundle;
14
+
15
+use Symfony\Component\HttpKernel\Bundle\Bundle;
16
+
17
+class VonrotenbergHtmxBundle extends Bundle
18
+{
19
+    public function getPath(): string
20
+    {
21
+        return \dirname(__DIR__);
22
+    }
23
+}