You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/modernizing-existing-add-ons.md
+15-7Lines changed: 15 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,34 +25,41 @@ To utilize the updated method for creating add-ons, you will need to make some s
25
25
[TOC]
26
26
27
27
## Updating your mod.addon.php file
28
-
In order to use the new approach, you will have to have your mod file use and extend the module add-on service
28
+
In order to use the new approach, you will have to have your mod file use and extend the module add-on service. Your mod file will also need to add the protected variable $addon_name in the class
29
29
30
30
31
31
```
32
32
use ExpressionEngine\Service\Addon\Module;
33
33
34
-
class Addon extends Module
34
+
class Amazing_add_on extends Module
35
+
{
36
+
protected $addon_name = 'amazing_add_on';
35
37
36
38
```
37
39
40
+
38
41
## Updating your mcp.addon.php file
39
42
40
-
In order to use the new approach, you will have to have your mcp file use and extend the Mcp add-on service
43
+
In order to use the new approach, you will have to have your mcp file use and extend the Mcp add-on service. Your mcp file will also need to add the protected variable $addon_name in the class
41
44
42
45
```
43
46
use ExpressionEngine\Service\Addon\Mcp;
44
47
45
-
class Addon_mcp extends Mcp
48
+
class Amazing_add_on_mcp extends Mcp
49
+
{
50
+
protected $addon_name = 'amazing_add_on';
46
51
```
47
52
48
53
## Updating your ext.addon.php file
49
54
50
-
In order to use the new approach, you will have to have your ext file use and extend the Extension add-on service
55
+
In order to use the new approach, you will have to have your ext file use and extend the Extension add-on service. Your ext file will also need to add the protected variable $addon_name in the class
51
56
52
57
```
53
58
use ExpressionEngine\Service\Addon\Extension;
54
59
55
-
class Addon_ext extends Extension
60
+
class Amazing_add_on_ext extends Extension
61
+
{
62
+
protected $addon_name = 'amazing_add_on';
56
63
```
57
64
58
65
## Updating your upd.addon.php file
@@ -62,7 +69,8 @@ In order to use the new approach, you will have to have your upd file use and ex
62
69
```
63
70
use ExpressionEngine\Service\Addon\Installer;
64
71
65
-
class Addon_upd extends Installer
72
+
class Amazing_add_on_upd extends Installer
73
+
{
66
74
```
67
75
## A Note on Plugins
68
76
If your add-on is currently a plugin and you are looking to take advantage of the new add-on development methodologies, we recommend migrating your plugin methods (functions) to your mod file first. This can be done with a simple copy and paste.
0 commit comments