From 86dd428257b4a3f782aa88e36ddeeff91ca6c3f0 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 10 Dec 2013 23:20:43 +0100 Subject: [PATCH] Added rules about namespace and package naming to extension docs --- docs/guide/extensions.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/guide/extensions.md b/docs/guide/extensions.md index fd7c3cc..271ba11 100644 --- a/docs/guide/extensions.md +++ b/docs/guide/extensions.md @@ -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). - 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 documents using `[[name()]]`. - 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. +### 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 ------------