Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/cli/built-in-commands/make-addon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# `make:addon`

Generates required add-on files in the `system/user/addons` directory.

TIP: Read the [Add-on Development Overview](development/addon-development-overview.md) to learn more about creating an add-on.

## Options list:

The first (unnamed) parameter is the add-on name.

Other options are:
```
--version=<value>
-v <value>
Version of the add-on

--description=<value>
-d <value>
Description of the add-on

--author=<value>
-a <value>
Author of the add-on

--author-url=<value>
-u <value>
Author url of the add-on
```
## Examples:

### Interactive example
```
$ php system/ee/eecli.php make:addon
Let's build your add-on!
What is the name of your add-on? Amazing Add-On
Add-on description? [Amazing Add-on description] This add-on does amazing things!
Add-on version? [1.0.0]1.0.0
Add-on author? ExpressionEngine Developer
Add-on author URL? www.expressionengine.com
Let's build!
Your add-on has been created successfully!
```

### One-line example

`php ../../system/ee/eecli.php make:addon "My Example Addon" -v 0.1.0 -d "Some good description" -a "ExpressionEngine" -u https://expressionengine.com`
2 changes: 1 addition & 1 deletion docs/cli/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ By default the CLI is located `system/ee/eecli.php` .
- [List](cli/built-in-commands/list.md)
- Make
- [make:action - Creates a new action for an add-on](cli/built-in-commands/make-action.md)
- [make:addon - Creates a new add-on](development/addon-development-overview.md)
- [make:addon - Creates a new add-on](cli/built-in-commands/make-addon.md)
- [make:command - Creates a new CLI command for an add-on](cli/built-in-commands/make-command.md)
- [make:extension-hook - Implements an EE extension hook in an add-on](cli/built-in-commands/make-extension-hook.md)
- [make:migration - Creates a new migration](cli/built-in-commands/make-migration.md)
Expand Down
10 changes: 5 additions & 5 deletions docs/development/add-on-update-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

## Overview

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.
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.

TIP:When using the CLI, your add-on update file will automatically be created for you. See [Building An Add-On: Getting Started](development/addon-development-overview.md#getting-started) for how to generate the starter files for your add-on.

## Initial Setup

When you first create your add-on using the [`make:addon`](development/addon-development-overview.md) command from the CLI, a `upd` file is created for you in the root of your add-on.
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.

Here I have created an add-on called Amazing Add-on using the CLI.

Expand Down Expand Up @@ -131,12 +131,12 @@ Be sure that you also update your [`install()` function](#adding-publish-tabs) t


## Update Your Add-on (`update()`)
The `update` method will run code when a user installs an update to our add-on.
The `update` method will run code when a user installs an update to our add-on.

| Parameter | Type | Description |
| --------- | --------- | ------------------------------------------------------------------ |
| \$current | `string` | The last recorded version of the module in the `exp_modules` table |
| Returns | `Boolean` | `FALSE` if no update is needed, `TRUE` otherwise
| Returns | `Boolean` | `FALSE` if no update is needed, `TRUE` otherwise

public function update($current = '')
{
Expand All @@ -150,7 +150,7 @@ The `update` method will run code when a user installs an update to our add-on.
// update database
// notify mission control of the update
}


return true;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/development/addon-development-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Here are some ideas of what you can accomplish with a custom add-on:
These are just a few ideas of what you can do with custom add-ons. The possibilities are almost endless.

## Getting Started
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).
Getting started making an add-on is incredibly easy with the CLI. To begin making an add-on, simply use the [`make:addon` command](/cli/built-in-commands/make-addon.md) from the [CLI](/cli/intro.html).

TIP: If you are working with an existing add-on, we recommend you start with [Modernizing add-ons](development/modernizing-existing-add-ons.md)

Expand Down