-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.php
More file actions
81 lines (77 loc) · 2.88 KB
/
Copy pathextension.php
File metadata and controls
81 lines (77 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
declare(strict_types=1);
/*
* Optional Studio extension runtime entry point.
*
* Studio may include this file only after extension validation and activation.
* Replace this placeholder with documented contribution objects when the
* extension needs runtime contributions such as settings, view injections,
* providers, hooks, scheduler tasks, or other supported contracts.
*
* Keep discovery side-effect free: do not read/write files, spawn processes,
* open network connections, inspect raw request/environment globals, or load
* extension code outside documented Studio extension points here.
*/
use App\Core\Extension\Settings\ExtensionSettingDefinition;
use App\Form\FormInputType;
use App\View\Injection\ConfigurableStaticViewInjectionRoute;
use App\View\Injection\ConfigurableStaticViewInjectionSet;
use App\View\Injection\DynamicViewInjection;
use App\View\Injection\DynamicViewInjectionFilter;
use App\View\Injection\DynamicViewInjectionSlot;
use App\View\Injection\ViewSurface;
return [
new ConfigurableStaticViewInjectionSet(
'demo-module',
'demo.route',
ViewSurface::Public,
'demo',
[
new ConfigurableStaticViewInjectionRoute(
'ext-demo-module-public-demo',
'',
'ext.demo-module.navigation.demo',
'@frontend/demo-module/frontend.html.twig',
sortOrder: 700,
),
new ConfigurableStaticViewInjectionRoute(
'ext-demo-module-public-typography',
'typography',
'ext.demo-module.navigation.typography',
'@frontend/demo-module/typography.html.twig',
sortOrder: 730,
),
],
),
new DynamicViewInjection(
'ext-demo-module-after-content',
ViewSurface::Public,
DynamicViewInjectionSlot::AfterContent,
'@frontend/demo-module/after-content.html.twig',
DynamicViewInjectionFilter::realContent(),
sortOrder: 700,
label: 'ext.demo-module.dynamic.after_content.label',
),
new ExtensionSettingDefinition(
'demo-module',
'display.mode',
'ext.demo-module.settings.display_mode.label',
'expanded',
description: 'ext.demo-module.settings.display_mode.help',
options: [
'compact' => 'ext.demo-module.settings.display_mode.options.compact',
'expanded' => 'ext.demo-module.settings.display_mode.options.expanded',
],
inputType: FormInputType::Select,
),
new ExtensionSettingDefinition(
'demo-module',
'demo.route',
'ext.demo-module.settings.demo_route.label',
'demo',
description: 'ext.demo-module.settings.demo_route.help',
inputType: FormInputType::Text,
validation: ['required' => true, 'pattern' => '^[a-z0-9][a-z0-9\/-]*$'],
sortOrder: 10,
),
];