Skip to content

Commit 216f5bc

Browse files
committed
Misc plugin/module intro cleanup
1 parent 759a7f6 commit 216f5bc

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

docs/4.x/extend/module-guide.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ my-project/
4040

4141
## Set up class autoloading
4242

43-
Next up, you need to tell Composer how to find your module’s classes by setting the [`autoload`](https://getcomposer.org/doc/04-schema.md#autoload) field in your project’s `composer.json` file. For example, if your module’s namespace is `foo`, and it’s located at `modules/foo/`, this is what you should add:
43+
Next up, you need to tell Composer how to find your module’s classes by setting the [`autoload`](https://getcomposer.org/doc/04-schema.md#autoload) field in your project’s `composer.json` file. Unlike a plugin, modules don’t need their own `composer.json` file.
44+
45+
If your module’s namespace is `foo`, and it’s located at `modules/foo/`, this is what you should add:
4446

4547
```json
4648
{

docs/4.x/extend/plugin-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Package name
1212
: Used to name your Composer package for the plugin. (See Composer’s [documentation][package name] for details.) We recommend prefixing the second segment (after the `/`) with `craft-`, to help identify that this is a Craft plugin. For example, `pixelandtonic/craft-recipes`.
1313

1414
Namespace
15-
: The root namespace that your plugin’s classes will live in. (See the [PSR-4] autoloading specification for details.) Note that this should _not_ begin with `craft\`; use something that identifies you, the developer.
15+
: The root namespace that your plugin’s classes will live in. (See the [PSR-4] autoloading specification for details.) Note that this should _not_ begin with `craft\`; use something that identifies you, the developer or vendor.
1616

1717
Plugin handle
1818
: Something that uniquely identifies your plugin within the Craft ecosystem. (Plugin handles must begin with a letter and contain only lowercase letters, numbers, and dashes. They should be `kebab-cased`.)

docs/5.x/extend/module-guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ my-project/
4040

4141
## Set up class autoloading
4242

43-
Next up, you need to tell Composer how to find your module’s classes by setting the [`autoload`](https://getcomposer.org/doc/04-schema.md#autoload) field in your project’s `composer.json` file. For example, if your module’s namespace is `foo`, and it’s located at `modules/foo/`, this is what you should add:
43+
Next up, you need to tell Composer how to find your module’s classes by setting the [`autoload`](https://getcomposer.org/doc/04-schema.md#autoload) field in your project’s `composer.json` file. Unlike a plugin, modules don’t need their own `composer.json` file.
44+
45+
If your module’s namespace is `foo`, and it’s located at `modules/foo/`, this is what you should add:
4446

4547
```json
4648
{
@@ -68,7 +70,6 @@ The `Module.php` file is your module’s entry point for the system. Its `init()
6870
Use this template as a starting point for your `Module.php` file:
6971

7072
```php
71-
<?php
7273
namespace foo;
7374

7475
use Craft;

docs/5.x/extend/plugin-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Package name
1212
: Used to name your Composer package for the plugin. (See Composer’s [documentation][package name] for details.) We recommend prefixing the second segment (after the `/`) with `craft-`, to help identify that this is a Craft plugin. For example, `pixelandtonic/craft-recipes`.
1313

1414
Namespace
15-
: The root namespace that your plugin’s classes will live in. (See the [PSR-4] autoloading specification for details.) Note that this should _not_ begin with `craft\`; use something that identifies you, the developer.
15+
: The root namespace that your plugin’s classes will live in. (See the [PSR-4] autoloading specification for details.) Note that this should _not_ begin with `craft\`; use something that identifies you, the developer or vendor.
1616

1717
Plugin handle
1818
: Something that uniquely identifies your plugin within the Craft ecosystem. (Plugin handles must begin with a letter and contain only lowercase letters, numbers, and dashes. They should be `kebab-cased`.)

0 commit comments

Comments
 (0)