Commit 86dd4282 by Alexander Makarov

Added rules about namespace and package naming to extension docs

parent ec7546ef
...@@ -6,12 +6,19 @@ Code style ...@@ -6,12 +6,19 @@ Code style
- Extension code style should be similar to [core framework code style](https://github.com/yiisoft/yii2/wiki/Core-framework-code-style). - Extension code style should be similar to [core framework code style](https://github.com/yiisoft/yii2/wiki/Core-framework-code-style).
- In case of using getter and setter for defining a property it's preferred to use method in extension code rather than property. - In case of using getter and setter for defining a property it's preferred to use method in extension code rather than property.
- TBD: namespace
- All classes, methods and properties should be documented using phpdoc. Note that you can use markdown and like to API - All classes, methods and properties should be documented using phpdoc. Note that you can use markdown and like to API
documents using `[[name()]]`. documents using `[[name()]]`.
- If you're displaying errors to developers do not translate these (i.e. do not use `\Yii::t()`). Errors should be - If you're displaying errors to developers do not translate these (i.e. do not use `\Yii::t()`). Errors should be
translated only if they're displayed to end users. translated only if they're displayed to end users.
### Namespace and package names
- Extension MUST use the type `yii2-extension` in `composer.json` file.
- Extension MUST NOT use `yii` or `yii2` in the composer package name or in the namespaces used in the package.
- Extension SHOULD use namespaces in this format `vendor-name\package` (all lowercase).
- Extension MAY use a `yii2-` prefix in the composer vendor name (URL).
- Extension MAY use a `yii2-` prefix in the repository name (URL).
Distribution Distribution
------------ ------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment