|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace App\Config; |
| 6 | + |
| 7 | +use Windwalker\Core\Attributes\ConfigModule; |
| 8 | +use Windwalker\Core\Edge\Component\XComponent; |
| 9 | +use Windwalker\Core\Theme\BootstrapTheme; |
| 10 | +use Windwalker\Core\Theme\ThemeInterface; |
| 11 | +use Windwalker\Edge\Provider\EdgeProvider; |
| 12 | +use Windwalker\Renderer\EdgeRenderer; |
| 13 | +use Windwalker\Renderer\MustacheRenderer; |
| 14 | +use Windwalker\Renderer\PlatesRenderer; |
| 15 | +use Windwalker\Renderer\Provider\RendererProvider; |
| 16 | +use Windwalker\Renderer\RendererPackage; |
| 17 | +use Windwalker\Renderer\TwigRenderer; |
| 18 | + |
| 19 | +return #[ConfigModule(name: 'renderer', enabled: true, priority: 100, belongsTo: RendererPackage::class)] |
| 20 | +static fn() => [ |
| 21 | + 'paths' => [ |
| 22 | + '@root/views', |
| 23 | + ], |
| 24 | + |
| 25 | + 'namespaces' => [ |
| 26 | + '@front' => [ |
| 27 | + '@source/Module/Front', |
| 28 | + ], |
| 29 | + '@admin' => [ |
| 30 | + '@source/Module/Admin', |
| 31 | + ], |
| 32 | + ], |
| 33 | + |
| 34 | + 'renderers' => [ |
| 35 | + 'edge' => [ |
| 36 | + EdgeRenderer::class, |
| 37 | + ['edge.php', 'blade.php'], |
| 38 | + ], |
| 39 | + // We use edge to replace blade |
| 40 | + // 'blade' => [ |
| 41 | + // BladeRenderer::class, |
| 42 | + // ['blade.php'] |
| 43 | + // ], |
| 44 | + 'plates' => [ |
| 45 | + PlatesRenderer::class, |
| 46 | + ['php'], |
| 47 | + ], |
| 48 | + 'mustache' => [ |
| 49 | + MustacheRenderer::class, |
| 50 | + ['mustache'], |
| 51 | + ], |
| 52 | + 'twig' => [ |
| 53 | + TwigRenderer::class, |
| 54 | + ['twig'], |
| 55 | + ], |
| 56 | + ], |
| 57 | + |
| 58 | + 'options' => [ |
| 59 | + 'cache_path' => WINDWALKER_CACHE . '/renderer', |
| 60 | + ], |
| 61 | + |
| 62 | + 'pagination' => [ |
| 63 | + 'template' => '@pagination', |
| 64 | + 'neighbours' => 4, |
| 65 | + ], |
| 66 | + |
| 67 | + 'aliases' => [ |
| 68 | + '@pagination' => 'layout.pagination.basic-pagination', |
| 69 | + '@messages' => 'layout.messages.bs5-messages', |
| 70 | + '@csrf' => 'layout.security.csrf', |
| 71 | + ], |
| 72 | + |
| 73 | + 'edge' => [ |
| 74 | + 'components' => [ |
| 75 | + 'component' => XComponent::class, |
| 76 | + 'template' => XComponent::class, |
| 77 | + ], |
| 78 | + 'component_scans' => [ |
| 79 | + 'App\\Component', |
| 80 | + ], |
| 81 | + ], |
| 82 | + |
| 83 | + 'providers' => [ |
| 84 | + RendererProvider::class, |
| 85 | + EdgeProvider::class, |
| 86 | + ], |
| 87 | + |
| 88 | + 'bindings' => [ |
| 89 | + ThemeInterface::class => BootstrapTheme::class, |
| 90 | + ], |
| 91 | + |
| 92 | + 'extends' => [ |
| 93 | + // |
| 94 | + ], |
| 95 | +]; |
0 commit comments