Skip to content

Commit 91cedc3

Browse files
author
Andy McCormick
committed
grammar updates
1 parent fcfbb1f commit 91cedc3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/development/extensions.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ lang: php
1717

1818
## Overview
1919

20-
Within ExpressionEngine are what is known as 'hooks'; little snippets of code in over 100 strategic places that allow the calling of third-party scripts that can rewrite and modify the inner workings of the program. By hooking into the core, you can do things like modify an entire Control Panel page, add/remove functionality, and modify the appearance of certain page elements. Hooks enable third party developers to modify aspects of ExpressionEngine without hacking the backend scripts.
20+
Within ExpressionEngine are what is known as "hooks"; little snippets of code in over 100 strategic places that allow the calling of third-party scripts that can rewrite and modify the inner workings of the program. By hooking into the core, you can do things like modify an entire Control Panel page, add/remove functionality, and modify the appearance of certain page elements. Hooks enable third party developers to modify aspects of ExpressionEngine without hacking the core.
2121

22-
## Generate Our Files
22+
## Generate Our Extension Files
2323

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

2626
```
27-
php system/ee/eecli.php make:extension-hook
27+
$ php system/ee/eecli.php make:extension-hook
2828
```
2929

3030
Follow the prompts to add an extension file to your add-on.
3131

3232
TIP: Files that interact with ExpressionEngine core hooks are referred to as "extensions" because they extend the functionality of ExpressionEngine.
3333

34-
This will create an `ext[addon_name].php` file in our add-on along with an `Extensions` folder where will build out the code we want to run when we interact with a core hook. Inside our `Extensions` folder the CLI will create a file with the same name as the core hook we plan to use.
34+
This will create an `ext[addon_name].php` file in our add-on along with an `Extensions` folder where we will build out the code we want to run when we interact with a core hook. Inside our `Extensions` folder the CLI will create a file with the same name as the core hook we plan to use.
3535

3636
```
3737
amazing_add_on
@@ -47,8 +47,8 @@ TIP: A single add-on can interact with as many hooks as you want.
4747

4848
Prior to ExpressionEngine 6.4.0 and 7.2.0, all code that was used to hook into the core was placed in our `ext.[addon_name].php` file. However, now that file mainly just extends the `Extension` service and routes ExpressionEngine to reference the `Extensions` folder in our add-on.
4949

50-
## `AddonName\Extensions`
51-
Once we've added the abillity 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.
50+
## `AddonName/Extensions`
51+
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.
5454

@@ -86,9 +86,9 @@ class TypographyParseTypeEnd extends AbstractRoute
8686

8787
As we can see, the CLI has correctly created a new class using our core hook in PascalCase as the name.
8888

89-
Inside our class is the `process()` function. Again the CLI has already added all parameters that will be passed in from the core hook. Reference the Available Core Hooks section of the docs to read on what parameters your hook uses.
89+
Inside our class is the `process()` function. Again the CLI has already added all parameters that will be passed in from the core hook. Reference the [Available Core Hooks]() section of the docs to read on what parameters your hook uses.
9090

91-
From the [`typography_parse_type_end()`](/development/extension-hooks/global/typography.html#typography_parse_type_endstr-this-prefs) docs we can see that this hook modifies string after all other typography is processed. Thus we should be able to take a string, manipulate it, then pass it back to ExpressionEngine to be rendered in the template.
91+
From the [`typography_parse_type_end()`](/development/extension-hooks/global/typography.html#typography_parse_type_endstr-this-prefs) docs we can see that this hook modifies a string after all other typography is processed. Thus we should be able to take a string, manipulate it, then pass it back to ExpressionEngine to be rendered in the template.
9292

9393
We know that we should expect the following parameters for this hook:
9494

@@ -117,6 +117,8 @@ class TypographyParseTypeEnd extends AbstractRoute
117117
{
118118
public function process($str, $obj, $prefs)
119119
{
120+
//check if $str has content, if so replace
121+
//all "e" with "EE"
120122
if(!is_null($str) ){
121123
$str = str_replace("e","EE",$str);
122124
}

0 commit comments

Comments
 (0)