Skip to content

Commit 12380b2

Browse files
author
Andy McCormick
committed
updated headings
1 parent d0dd690 commit 12380b2

File tree

10 files changed

+42
-44
lines changed

10 files changed

+42
-44
lines changed

docs/cli/creating-a-command.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can also build your own commands that will enable users to interact with you
99

1010
NOTE:Before adding a custom CLI Command to your add-on, you need to already have an add-on in place. 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.
1111

12-
## Generate Our Add-on
12+
## Creating An Amazing Command
1313
We add custom commands to the CLI when our add-on is installed by using the CLI.
1414

1515
```
@@ -26,16 +26,6 @@ amazing_add_on
2626
┃ ┣ Command[CommandName].php
2727
```
2828

29-
## `addon.setup.php`
30-
31-
We see that the CLI has added our `Commands` folder and created our new class. However, the CLI has also modified our `addon.setup.php` file as well.
32-
33-
```
34-
amazing_add_on
35-
┣ Commands
36-
┃ ┣ CommandAnAmazingCommand.php
37-
```
38-
3929
CLI Commands are installed through an add-on's `addon.setup.php` file. The CLI takes care of this for us. We can see here that CLI creates the `$commands` array inside the array that gets returned from our `addon.setup.php` file.
4030

4131
```
@@ -61,7 +51,7 @@ return [
6151

6252
Now when our add-on is installed, users will have access to our new command.
6353

64-
## `\Commands\Command[CommandName]`
54+
## Anatomy of a Command - `/Commands/Command[CommandName]`
6555
Inside of our add-on we now have a file named with our command's name (in PascalCase).
6656

6757
In this example we have created a new command named "An Amazing Command" to our Amazing Add-on:
@@ -124,11 +114,6 @@ class CommandAnAmazingCommand extends Cli
124114
}
125115
```
126116

127-
128-
## Anatomy of a Command
129-
130-
Creating commands is simple. Each commands is built in a similar way as part of a custom add-on:
131-
132117
### Class Structure
133118

134119
Your class can have any name, and should be namespaced to your addon. When creating your class, make sure to include:

docs/development/actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Actions in ExpressionEngine are URL endpoints that are reached with the `ACT` qu
1616

1717
NOTE:Before adding an action to your add-on, you need to already have an add-on in place. 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.
1818

19-
## How To Build An Amazing Action?
19+
## Creating An Amazing Action
2020
To generate an action we use the CLI to add the action to our existing add-on named "Amazing Add-on".
2121

2222
```
@@ -90,7 +90,7 @@ On creation of an action, you can also specify to add it to the database after t
9090

9191

9292

93-
## AddonName/Module/Actions
93+
## Anatomy of An Action
9494

9595
Once we've added an action to our add-on, an `Actions` folder is created inside our add-on's `Module` folder. The CLI will generate a class and respective file for us based on the action name we passed to the CLI when creating our action. In this case we added an action named "ExampleAction" to Amazing Add-on.
9696

@@ -174,7 +174,7 @@ $ php system/ee/eecli.php make:action --csrf_exempt
174174

175175

176176

177-
## Do Something
177+
## Do Something - Build An Action
178178

179179
Let's do something with our action to demonstrate how this would work.
180180

docs/development/add-on-update-file.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99

1010
# Add-on Update File
1111

12+
## Overview
13+
1214
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.
1315

16+
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.
17+
1418
## Initial Setup
1519

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

docs/development/addon-setup-php-file.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ lang: php
1515

1616
[TOC]
1717

18+
## Overview
19+
1820
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. Below we walk through the format and available keys. However, most of the time, the CLI will take care of generating and updating this file as needed for you.
1921

20-
## Format
22+
23+
TIP:When using the CLI, your add-on setup 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.
24+
25+
## Anatomy Of The Add-On Setup File
2126

2227
The file must return an associative array. For example:
2328

docs/development/custom-template-tags.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Creating your own custom template tags allows you to display dynamic data from y
2323

2424
NOTE:Before adding a template tag to your add-on, you need to already have an add-on in place. 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.
2525

26-
## Creating Template Tags
26+
## Creating An Amazing Template Tag
2727
Tags are created via the CLI by using the `make:template-tag` command.
2828

2929
```
@@ -42,7 +42,10 @@ amazing_add_on
4242
┗ ...
4343
```
4444

45-
## `class [TagName]`
45+
## Anatomy of A Template Tag
46+
47+
**class** `class [TagName]`
48+
4649
Inside `Modules/Tags/ExampleTag.php` we see the following code generated for us:
4750

4851
```
@@ -139,7 +142,7 @@ This would render in the browser as:
139142
Here is some amazing text: ExpressionEngine is the best CMS in the world!
140143
```
141144

142-
## Creating Tag Pair Template Tags
145+
## Do Something - Create A Tag Pair Template Tag
143146

144147
Often you will want to process content contained between a pair of tags. Let's create a simple tag that makes text bold to illustrate how this is done. Our example plugin will have this syntax:
145148

@@ -182,11 +185,13 @@ class Bold extends AbstractRoute
182185
183186
```
184187

188+
Now We need to capture the content between our opening and closing tags, and return that context as bold text. In ExpressionEngine, this is called fetching tagdata.
189+
185190

186191
### Fetching Tagdata
187192
In our class, we use `ee()->TMPL->tagdata;` to capture the template data that is between our opening and closing tag.
188193

189-
In this example we will capture the text we want to make bold in our template and render it back to the browser.
194+
Let's update our example to capture the text we want to make bold in our template and render it back to the browser.
190195

191196
Our tag's class:
192197

@@ -215,7 +220,7 @@ We want to bold <b>this text</b>.
215220

216221
As you can see, any template data between our opening and closing tags is captured using `ee()->TMPL->tagdata`.
217222

218-
## Parameters
223+
## Do Something - Create A Template Tag With Parameters
219224
Both single tags and tag pairs can accept parameters. The template engine makes it easy to fetch them using the following variable:
220225

221226
ee()->TMPL->fetch_param('param_name');
@@ -277,7 +282,7 @@ class format extends AbstractRoute
277282
278283
```
279284

280-
## Variables
285+
## Using Variables In Your Template Tag
281286
With variables, we can take our tag a step further. Imagine that you have tag pair that you want to use to return data based on some parameters. We can do that using variables inside of our tag.
282287

283288
We all know and love [`{exp:channel:entries}`](channels/entries.md). We use the Channel Entries tag by opening and closing the tag, passing some parameters, and then placing some template tags in our template that we know the tag will replace when rendered.
@@ -294,7 +299,7 @@ This typically looks something like this:
294299
In the snippet above, we're passing in the `channel` and `limit` as parameters. We're then expecting the Channel Entries tag to replace the `{title}` and `{body}` **variables** when the tag is parsed. Now, let's do something similar to our add-on.
295300

296301

297-
## Create A Tag With Variables
302+
## Do Something - Create A Tag With Variables
298303
Let's add a tag to our add-on that will render the current date and time. The user can pass in their timezone and the tag will return the current Date and time.
299304

300305
First, generate the tag (we're calling our tag "date and time" and adding it to our Amazing Add-On):

docs/development/extensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Within ExpressionEngine are what is known as "hooks"; little snippets of code in
2121

2222
NOTE:Before adding an extension hook to your add-on, you need to already have an add-on in place. 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.
2323

24-
## Creating Our Extension Files
24+
## Creating An Amazing Extension
2525

2626
We can give our add-on the ability to hook into the core of ExpressionEngine by using the CLI:
2727

@@ -47,7 +47,7 @@ amazing_add_on
4747

4848
TIP: A single add-on can interact with as many hooks as you want.
4949

50-
## `AddonName/Extensions`
50+
## Anatomy Of An Extension
5151
Once we've added the ability to hook into the core with our add-on, an `Extensions` folder is created. The CLI will generate a class and a respective file for each core hook we wish to use.
5252

5353
Here we have added the ability to interact with the [`typography_parse_type_end()`](/development/extension-hooks/global/typography.html#typography_parse_type_endstr-this-prefs) hook.

docs/development/fieldtypes/fieldtypes.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TIP: For an overview of what a Fieldtype is, read the [Fieldtype Overview docs](
2222

2323
NOTE:Before adding a fieldtype to your add-on, you need to already have an add-on in place. 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.
2424

25-
## Creating A Custom Fieldtype
25+
## Creating An Amazing Fieldtype
2626

2727
Adding a custom fieldtype to your add-on is easy with the `make:fieldtype` command.
2828

@@ -44,7 +44,9 @@ amazing_add_on
4444
┗ ...
4545
```
4646

47-
## Basic Fieldtype File Structure
47+
## Anatomy of A Fieldtype
48+
49+
[TOC=3]
4850

4951
All fieldtypes must inherit from the `EE_Fieldtype` base class and they must provide an `$info` array with a name and version number.
5052

@@ -78,9 +80,6 @@ NOTE: **Note:** Fieldtypes can declare their compatibility with other Fieldtypes
7880
NOTE: We also have [Example fieldtype with annotations](development/fieldtypes/example.md) for your reference.
7981

8082

81-
## Development Reference
82-
83-
[TOC=3]
8483

8584
### Class Variables
8685

@@ -573,6 +572,6 @@ A jQuery object of the field being affected by the current event is passed to th
573572

574573
NOTE: **Note:** Please refer to [Enhanced Fieldtype Features](development/fieldtypes/enhanced.md) page for advanced topics, such ad working with Live Preview, Entry Manager, Entry Cloning, File Picker and Conditional Fields.
575574

576-
## Do Something: Build A Fieldtype
575+
## Do Something - Build A Fieldtype
577576

578577
For a complete fieldtype example see the [Google Maps Fieldtype example](/development/fieldtypes/example.md).

docs/development/modules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
0---
1+
---
22
lang: php
33
---
44

@@ -22,7 +22,7 @@ NOTE:**NOTE:** Control Pages are what is rendered in the browser when visiting y
2222

2323
NOTE:Before adding a Control Panel route to your add-on, you need to already have an add-on in place. 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.
2424

25-
## Generate Your Route
25+
## Creating An Amazing Control Panel Route
2626

2727
If your add-on doesn't already have the required `Mcp` and `views` files, you can add a route to your add-on using the `make:mcp-route` command in the CLI.
2828

@@ -37,7 +37,7 @@ This will create an `mcp.[addon_name].php` file in your add-on along with a `Mcp
3737
Inside of the `Mcp` folder, you will see that the CLI has created your first control route with `Mcp/Index.php` and a corresponding view in you `views` folder. This page is accessible via The Add-On Manager -> [Add-On Name] or via the `/admin.php?/cp/addons/settings/[add-on-name]` URL.
3838

3939

40-
## Your First Control Panel Page
40+
## Anatomy Of A Control Panel Route
4141
When you first add a route to your add-on an `Mcp` folder along with an `Mcp/Index.php` starter file is created. The starter file will look something like this:
4242

4343
```

docs/development/prolets.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Here is an example of the add-on SEEO's prolet, which easily allows editors to e
2020

2121
NOTE:Before adding a Prolet to your add-on, you need to already have an add-on in place. 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.
2222

23-
## Creating A Prolet
23+
## Creating An Amazing Prolet
2424

2525
Creating a Prolet is straightforward using the `make:prolet` command in the CLI.
2626

@@ -40,7 +40,7 @@ amazing_add_on
4040
```
4141

4242

43-
## Prolet File Structure
43+
## Anatomy Of A Prolet
4444

4545
Inside a prolet file, you are required to define the prolet class. The class name should consist of prolet name with the first letter capitalized followed by `_pro` postfix. So for the example above, the class name will be `Sample_prolet_pro`.
4646

@@ -68,7 +68,6 @@ class Amazing_add_on_pro extends AbstractProlet implements ProletInterface
6868
}
6969
```
7070

71-
## Properties and Methods
7271

7372
### Icon
7473
On each page load, prolets appear on the front-end as Dock buttons. If not specified otherwise, `icon.svg` from the add-on package folder is used as the Dock button. If you want to specify a different icon to use from the add-on's folder, you can do that using `protected $icon` property or `public function getIcon()`.

docs/development/tab-files.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ lang: php
1414

1515
# Adding Publish Layout Tabs
1616

17+
[TOC]
1718

1819
## Overview
1920
Add-ons can also add 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. Two things are required for your add-on to have this functionality:
@@ -25,7 +26,7 @@ Here is an example of the publish layout's tab for the Structure add-on:
2526

2627
NOTE:Before adding a tab to your add-on, you need to already have an add-on in place. 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.
2728

28-
## Creating The Tab File
29+
## Creating An Amazing Tab File
2930
Tab files are not currently able to be generated through the CLI, thus you will need to manually create the file `tab.[addon_name].php` in the root of your add-on's folder.
3031

3132
```
@@ -35,7 +36,7 @@ amazing_add_on
3536
┗...
3637
```
3738

38-
## The Tab File Structure
39+
## Anatomy Of A Tab File
3940

4041
```
4142
<?php

0 commit comments

Comments
 (0)