@@ -28,30 +28,34 @@ Tags are created via the CLI by using the `make:template-tag` command.
2828
2929```
3030php system/ee/eecli.php make:template-tag
31+ Let's build a new tag!
32+ What is the tag name? Amazing
33+ What add-on is the tag being added to? [amazing_add_on]: amazing_add_on
34+ Building Tag.
35+ Tag created successfully!
3136```
3237
3338Follow the prompts to add a tag file to your add-on.
3439
35- This will create an ` Models/ Tags` folder in your add-on.
40+ This will create a ` Tags ` folder in your add-on.
3641
3742```
3843amazing_add_on
39- ┣ Module
40- ┃ ┗ Tags
41- ┃ ┃ ┗ ExampleTag.php
44+ ┣ Tags
45+ ┃ ┗ AmazingTag.php
4246 ┗ ...
4347 ```
4448
4549## Anatomy of A Template Tag
4650
4751** class** ` class [TagName] `
4852
49- Inside ` Modules/ Tags/ExampleTag.php` we see the following code generated for us:
53+ Inside ` Tags/ExampleTag.php ` we see the following code generated for us:
5054
5155```
5256<?php
5357
54- namespace ExpressionengineDeveloper\AmazingAddOn\Module\ Tags;
58+ namespace ExpressionengineDeveloper\AmazingAddOn\Tags;
5559
5660use ExpressionEngine\Service\Addon\Controllers\Tag\AbstractRoute;
5761
@@ -115,7 +119,7 @@ This generates the class for our add-on:
115119```
116120<?php
117121
118- namespace ExpressionengineDeveloper\AmazingAddOn\Module\ Tags;
122+ namespace ExpressionengineDeveloper\AmazingAddOn\Tags;
119123
120124use ExpressionEngine\Service\Addon\Controllers\Tag\AbstractRoute;
121125
@@ -165,12 +169,12 @@ What add-on is the tag being added to? [amazing_add_on,...]: amazing_add_on
165169Tag created successfully!
166170```
167171
168- Now we have our template tag's class located at ` Modules/ Tags/Bold.php` :
172+ Now we have our template tag's class located at ` Tags/Bold.php ` :
169173
170174```
171175<?php
172176
173- namespace ExpressionengineDeveloper\AmazingAddOn\Module\ Tags;
177+ namespace ExpressionengineDeveloper\AmazingAddOn\Tags;
174178
175179use ExpressionEngine\Service\Addon\Controllers\Tag\AbstractRoute;
176180
@@ -245,12 +249,12 @@ What add-on is the tag being added to? [amazing_add_on,...]: amazing_add_on
245249Tag created successfully!
246250```
247251
248- Now we have our template tag's class located at ` Modules/ Tags/Format.php` :
252+ Now we have our template tag's class located at ` Tags/Format.php ` :
249253
250254```
251255<?php
252256
253- namespace ExpressionengineDeveloper\AmazingAddOn\Module\ Tags;
257+ namespace ExpressionengineDeveloper\AmazingAddOn\Tags;
254258
255259use ExpressionEngine\Service\Addon\Controllers\Tag\AbstractRoute;
256260
@@ -311,10 +315,10 @@ What add-on is the tag being added to? [amazing_add_on,...]: amazing_add_on
311315Tag created successfully!
312316```
313317
314- Now, let's update the ` DateAndTime ` class (` Module/ Tags/DateAndTime.php` ) to read the timezone that is passed in:
318+ Now, let's update the ` DateAndTime ` class (` Tags/DateAndTime.php ` ) to read the timezone that is passed in:
315319
316320```
317- namespace ExpressionengineDeveloper\AmazingAddOn\Module\ Tags;
321+ namespace ExpressionengineDeveloper\AmazingAddOn\Tags;
318322
319323use ExpressionEngine\Service\Addon\Controllers\Tag\AbstractRoute;
320324
@@ -333,7 +337,7 @@ class DateAndTime extends AbstractRoute
333337Now we drop in some magic using the ` TMPL::parse_variables ` method that's provided by the [ ` Template Class ` ] ( development/legacy/libraries/template.md ) . Here we'll get the current date and time, then create an array of variables the user can use in their template to show the current date and time.
334338
335339```
336- namespace ExpressionengineDeveloper\AmazingAddOn\Module\ Tags;
340+ namespace ExpressionengineDeveloper\AmazingAddOn\Tags;
337341
338342use ExpressionEngine\Service\Addon\Controllers\Tag\AbstractRoute;
339343
0 commit comments