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/add-on-update-file.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@
7
7
@license https://expressionengine.com/license Licensed under Apache License, Version 2.0
8
8
-->
9
9
10
-
# Add-on Update File`upd.[addon_name].php`
10
+
# Add-on Update File
11
11
12
-
The `upd.[addon_name].php` file (commonly just called the `upd` file) is critical to ExpressionEngine knowing what to do with your add-on. Here we tell ExpressionEngine what actions to register, core hooks we want to use, database tables to update, and much more. We need to tell ExpressionEngine what to do when we install and add-on, update an add-on, and uninstall and add-on. Thankfully the CLI takes care of most of this for us.
12
+
The `upd.[addon_name].php` file (commonly just called the `upd` file) is critical to ExpressionEngine knowing what to do with your add-on. Here we tell ExpressionEngine what actions to register, core hooks we want to use, database tables to update, and much more. We need to tell ExpressionEngine what to do when we install an add-on, update an add-on, and uninstall and add-on. Thankfully the CLI takes care of most of this for us.
13
13
14
14
## Initial Setup
15
15
16
16
When you first create your add-on using the [`make:addon`](/cli/built-in-commands/make-addon.md) command from the CLI, a `upd` file is created for you in the root of your add-on.
17
17
18
-
Here I have created an Amazing Add-on which currently has a module and has some extensions that interact with the core hooks.
18
+
Here I have created an add-on called Amazing Add-on using the CLI.
19
19
20
20
```
21
21
<?php
@@ -64,7 +64,7 @@ The first thing you will notice in our `Amazing_add_on_upd` class is a list of p
64
64
```
65
65
66
66
## Install Your Add-On (`install()`)
67
-
The CLI automatically generates our install method. This method will ensure that all extensions and actions declared above will be properly installed. If you just need to install actions and/or extensions, then you can leave this method as is. Otherwise use this section to add tabs to saved [publish layouts](), update the database, or do something else when the add-on is installed.
67
+
The CLI automatically generates our install method. This method will ensure that all extensions and actions declared above will be properly installed. If you only need to install actions and/or extensions, then you can leave this method as is. Otherwise, use this section to add tabs to saved [publish layouts](), update the database, or do something else when the add-on is installed.
68
68
69
69
70
70
| Parameter | Type | Description |
@@ -98,7 +98,7 @@ Optionally add the publish page tab fields to any saved publish layouts. This is
| Returns |`Array`| Associative array of the tab name and tab fields |
100
100
101
-
An optional function, included only if your add-on adds a tab to the publish page. This function should return an multidimensional associative array, the top array key consisting of the tab name, followed by any field names, with each field having a variety of default settings. Note that when the fields are added to the publish page, they are namespaced to prevent variable collisions:
101
+
An optional function included only if your add-on adds a tab to the publish page. This function should return a multidimensional associative array: the top array key consisting of the tab name, followed by any field names, with each field having a variety of default settings. Note that when the fields are added to the publish page, they are namespaced to prevent variable collisions:
102
102
103
103
function tabs()
104
104
{
@@ -127,7 +127,7 @@ Be sure that you also update your [`install()` function](#adding-publish-tabs) t
127
127
128
128
129
129
## Update Your Add-on (`update()`)
130
-
The `update` method is will run code when a user installs an update to our add-on.
130
+
The `update` method will run code when a user installs an update to our add-on.
Copy file name to clipboardExpand all lines: docs/development/addon-development-overview.md
+33-33Lines changed: 33 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@
9
9
10
10
# Add-on Development Overview
11
11
12
-
With custom add-ons you can add new fieldtypes, features, template tags, and much more to ExpressionEngine. Here we are going to look at the different parts of an add-on and how to define just what our add-on is going to do.
12
+
With custom add-ons you can add new fieldtypes, features, template tags, and much more to ExpressionEngine. Here we are going to look at different parts of an add-on, and how to define just what our add-on is going to do.
13
13
14
-
TIP: In this section we're explaining the parts of an add-on. No need to memorize everything though, the [CLI](/cli/intro.html) will generate all the pieces we need based on what functions we want our add-on to have.
14
+
TIP: In this section, we're explaining the parts of an add-on. No need to memorize everything though, the [CLI](/cli/intro.html) will generate all the pieces we need based on what functions we want our add-on to have.
15
15
16
16
[TOC]
17
17
@@ -21,18 +21,18 @@ While ExpressionEngine offers a lot of functionality right out of the box, somet
21
21
Here are some ideas of what you can accomplish with a custom add-on:
22
22
23
23
- Add custom [template tags](development/custom-template-tags.md) like `{exp:amazing_add_on:member_info}`.
24
-
- Run functions or return data when someone reaches a certain URL using [URL endpoints (called Actions)](development/actions.md).
24
+
- Run functions or return data when someone reaches a specific URL using [URL endpoints (called Actions)](development/actions.md).
25
25
- Add custom [fieldtypes](development/fieldtypes/fieldtypes.md) for content editors when creating channel entries.
26
26
- Add custom [CLI commands](cli/creating-a-command.md) like `$ eecli.php amazing_add_on:do_something_amazing`
27
27
- Add custom [Publish Form tabs](development/tab-files.md) to help organize entry fields for content editors.
28
28
- Hook into ExpressionEngine and run [custom functions (called Extensions)](development/extensions.md) when ExpressionEngine does certain actions, like emailing your team whenever a post is created or manipulating text when a template is rendered.
29
-
- Display information from from your add-on to content editors on the front-end by adding a [Prolet](/development/prolets.md) to the [ExpressionEngine Dock](/advanced-usage/front-end/dock.md).
29
+
- Display information from your add-on to content editors on the front-end by adding a [Prolet](/development/prolets.md) to the [ExpressionEngine Dock](/advanced-usage/front-end/dock.md).
30
30
- Display information in the [Control Panel Dashboard](/control-panel/dashboard_management.md) using a [custom Dashboard Widget](/development/widgets.md).
31
31
32
32
These are just a few ideas of what you can do with custom add-ons. The possibilities are almost endless.
33
33
34
34
## Getting Started
35
-
Getting started making your own add-on is incredibly easy with the CLI. To begin making an add-on simply use the `make:addon` command from the [CLI](/cli/intro.html).
35
+
Getting started making an add-on is incredibly easy with the CLI. To begin making an add-on simply, use the `make:addon` command from the [CLI](/cli/intro.html).
36
36
37
37
```
38
38
$ php system/ee/eecli.php make:addon
@@ -64,26 +64,26 @@ amazing_add_on/
64
64
┗ upd.amazing_add_on.php
65
65
```
66
66
67
-
This is the starting point of an add-on and is enough to begin creating template tags, extension hooks, and much more! From here you can add more functionality to your add-on depending on your needs.
67
+
This is the starting point of an add-on and is enough to begin creating template tags, extension hooks, and much more! From here, you can add more functionality to your add-on depending on your needs.
68
68
69
-
Here's a list of functionality that can be added to your add-on:
69
+
Here's a list of functionality that can be added to your add-on and the corresponding CLI command if applicable:
Continue reading below to understand all the files and folders found in the structure of an add-on.
83
83
84
84
## Add-On Structure
85
85
86
-
Below is the complete structure of an add-on that we'll call "Amazing Add-on". There's a lot in this structure, because this add-on can do a lot of things (it's amazing 😀)! Don't worry though, your add-on can be as simple or complex as you want to make it. This example just shows all the possibilities. Continue reading as we break down the parts of this add-on.
86
+
Below is the complete structure of an add-on that we'll call "Amazing Add-on". There's a lot in this structure because this add-on can do many things (it's amazing 😀)! Don't worry though; your add-on can be as simple or complex as you want to make it. This example just shows all the possibilities. Continue reading as we break down the parts of this add-on.
87
87
88
88
```
89
89
amazing_add_on
@@ -126,17 +126,17 @@ amazing_add_on
126
126
┗ upd.amazing_add_on.php
127
127
```
128
128
129
-
NOTE: **Note:** Pay attention to how these filenames are structured. For filenames, hyphens and special characters are removed and spaces are replaced with underscores.
129
+
NOTE: **Note:** Pay attention to how these filenames are structured. For filenames, hyphens and special characters are removed, and spaces are replaced with underscores.
130
130
131
131
132
132
### The Add-on Setup File (`addon.setup.php`)
133
-
Starting with version 3.0 each add-on in ExpressionEngine must have an `addon.setup.php` file in its package directory. This file provides descriptive data about a specific add-on such as author, name, and version.
134
-
Reference the [The Add-on Setup File](development/addon-setup-php-file.md) for more information on the contents of this file.
133
+
Starting with version 3.0 each add-on in ExpressionEngine must have an `addon.setup.php` file in its package directory. This file provides descriptive data about a specific add-on, such as author, name, and version.
134
+
Reference [The Add-on Setup File](development/addon-setup-php-file.md) for more information on the contents of this file.
135
135
136
136
### The Update File (`upd.[addon_name].php`)
137
137
**class `Add_on_name_upd extends Installer`**
138
138
The Update file for an add-on includes a class with a name that is a combination of the add-on's name with a `_upd` suffix. Here you define functionality that should be executed on installation, update, and uninstallation of your add-on.
139
-
Reference the [The Add-on Update File](development/add-on-update-file.md) for more information on this file.
139
+
Reference [The Add-on Update File](development/add-on-update-file.md) for more information on this file.
140
140
141
141
142
142
### The Extension File (`ext.[addon_name].php`)
@@ -151,54 +151,54 @@ Reference [Adding Fieldtypes](development/fieldtypes/fieldtypes.md) for more inf
151
151
152
152
### The Mcp File (`mcp.[addon_name].php`)
153
153
**class `Add_on_name_upd extends Mcp`**
154
-
The Mcp file is used to route ExpressionEngine to our `Mcp` Folder which contains logic for your Control Panel pages (settings or other pages you might want to add to the Control Panel for your users to interact with).
154
+
The Mcp file is used to route ExpressionEngine to our `Mcp` Folder, which contains logic for your Control Panel pages (settings or other pages you might want to add to the Control Panel for your users to interact with).
155
155
Reference [Adding Control Panel Pages](development/modules.md) for more information on adding Control Panel pages with your add-on.
156
156
157
157
### The Module File `mod.[addon_name].php`
158
158
**class `Add_on_name_upd extends Module`**
159
-
The module file is used to route ExpressionEngine to our `Modules` Folder which contains any actions or template tags you are adding with your add-on.
159
+
The module file is used to route ExpressionEngine to our `Modules` Folder, which contains any actions or template tags you are adding with your add-on.
160
160
Reference [Adding Template Tags](development/custom-template-tags.md) for more information on adding template tags with your add-on or [Adding Actions](development/actions.md) for more information on creating URL endpoints (actions) with your add-on.
161
161
162
162
### The Tab File (`tab.[addon_name].php`)
163
163
**class `Module_name_tab`**
164
-
The tab file is used to create tabs which are visible on in [Publish Layouts](control-panel/channels.md#publish-layouts). Respectivley these tabs would also be visible on the Entry Publish/Edit page if selected in the publish layout.
164
+
The tab file is used to create tabs that are visible in [Publish Layouts](control-panel/channels.md#publish-layouts). Respectively, these tabs would also be visible on the Entry Publish/Edit page if selected in the publish layout.
165
165
Reference [Adding Publish Form Tabs](development/tab-files.md) for more information on adding Publish Form Tabs with your add-on.
The prolet file is used to create new [Prolets](/development/prolets.md) with our add-on.
169
+
The Prolet file is used to create new [Prolets](/development/prolets.md) with our add-on.
170
170
Reference [Adding Prolets](development/prolets.md) for more information on adding prolets to your add-on.
171
171
172
172
### The Add-on Icon File `icon.svg`
173
173
The add-on icon folder is used both in the Add-on Manager and in the Dock on the front-end to distinguish your add-on from others.
174
174
175
175
### `/Extensions`
176
-
When we tell the CLI that we want to create an extension, classes are automatically created in the `Extensions` folder along with the above mentioned `ext.[addon_name].php` file. Interacting with hooks allow us to extend ExpressionEngine's functionality, thus we refer to these as "extensions".
176
+
When we tell the CLI that we want to create an extension, classes are automatically created in the `Extensions` folder along with the above mentioned `ext.[addon_name].php` file. Interacting with hooks allows us to extend ExpressionEngine's functionality, thus we refer to these as "extensions".
177
177
178
178
TIP: Reference the [Extensions](development/extensions.md) section of the docs for more information on using extensions in your add-on.
179
179
180
180
### `Module/Actions`
181
-
The `Module/Actions` folder stores all the business logic for any actions that we are adding to ExpressionEngine with our add-on. Each action will have a separate file and corresponding class created based information provided in the `$actions` array in the `upd` file.
181
+
The `Module/Actions` folder stores all the business logic for any actions that we are adding to ExpressionEngine with our add-on. Each action will have a separate file and corresponding class created based on information provided in the `$actions` array in the `upd` file.
182
182
183
183
### `Module/Tags`
184
-
The `Module/Tags` folder stores all the business logic for any template tags we are creating with our add-on.
184
+
The `Module/Tags` folder stores all the business logic for any template tags we create with our add-on.
185
185
186
186
### `/views`
187
-
The `views` folder contains all of our control panel views which will be used to actuall render our add-on's control panel pages.
187
+
The `views` folder contains all of our Control Panel views which will be used to render our add-on's control panel pages.
188
188
189
189
### `/language`
190
-
The `language` folder contains all of our lang files that will be used to display text on a page in whatever language is selected in the user’s account settings.
190
+
The `language` folder contains all of our language files that will be used to display text on a page in whatever language is selected in the user’s account settings.
191
191
192
192
### `/database/migrations`
193
-
The `/database/migrations` folder holds all migrations that will be ran on installation or updating of our add-on. Using the CLI, migrations can also be ran indepentantly.
193
+
The `/database/migrations` folder holds all migrations that will be ran on installation or updating of our add-on. Using the CLI, migrations can also be ran independently.
194
194
195
195
### `Model`
196
196
The `Model` folder holds all models that we are creating with our add-on.
197
197
198
198
### `widgets`
199
-
The `widgets` folder holds all dashboard widgets that we are creating with our add-on.
199
+
The `widgets` folder holds all dashboard widgets we create with our add-on.
200
200
201
201
## A Word About Legacy Add-On Development
202
-
In the past, add-ons were often categorized based on their functionality. We identified our add-on to ExpressionEngine as a fieldtype, extension, module, or plug-in. Thus there was never a clear process to of how to structure one add-on that was all these categories in one. With the release of 6.4.x and 7.2.x this has been updated. The CLI has been updated to make creating add-ons and adding functionality incredibly easy, while the docs have also been updated to reflect the ideal workflow of creating an add-on.
202
+
In the past, add-ons were often categorized based on their functionality. We identified our add-on to ExpressionEngine as a fieldtype, extension, module, or plug-in. Thus there was never a straightforward process on structuring one add-on that contained all these categories in one. With the release of 6.4.x and 7.2.x this has been updated. The CLI has been updated to make creating add-ons and adding functionality incredibly easy. At the same time, the docs have also been updated to reflect the ideal workflow of creating an add-on.
203
203
204
-
While the latest changes shift our view of add-ons and how developers will create add-ons, you may still come across add-ons using the old methodology. We have left much of the old methods and structure in place so that older add-ons will continue to work. However, we are choosing not actively update the documentation for the old methods because we feel it's no longer in the best interest of the community to develop add-ons in this way. If you need to access how the docs once were regarding add-ons add-ons, you can reference the [legacy docs in GitHub](https://github.com/ExpressionEngine/ExpressionEngine-User-Guide/releases/tag/legacy-add-on-structure).
204
+
While the latest changes shift our view of add-ons and how developers will create add-ons, you may still come across add-ons using the old methodology. We have left much of the old methods and structure in place so that older add-ons will continue to work. However, we are choosing to not actively update the documentation for the old methods because we feel it's no longer in the best interest of the community to develop add-ons in this way. If you need to access how the docs once were regarding add-ons, you can reference the [legacy docs in GitHub](https://github.com/ExpressionEngine/ExpressionEngine-User-Guide/releases/tag/legacy-add-on-structure) (note that v7 and v6 were the same in these regards).
0 commit comments