Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
bf6b2f0a
Commit
bf6b2f0a
authored
Jan 13, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated extension docs to be less restrictive about choosing namespace, more…
Updated extension docs to be less restrictive about choosing namespace, more neutral composer.json example
parent
ee109a6f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
extensions.md
docs/guide/extensions.md
+10
-10
No files found.
docs/guide/extensions.md
View file @
bf6b2f0a
...
...
@@ -13,7 +13,7 @@ Code style
-
Do not use
`yiisoft`
in the namespaces.
-
Do not use
`\yii`
,
`\yii2`
or
`\yiisoft`
as root namespace.
-
Use
`vendor-name
\type`
namespace format (all lowercase) where type may be
`widgets`
,
`behaviors`
,
`modules`
etc
.
-
Use
`vendor-name
`
as the root namespace
.
Distribution
------------
...
...
@@ -63,16 +63,16 @@ If your extension classes reside directly in repository root use PSR-4 the follo
```
{
"name": "
samdark/yii2-iconized-menu-
widget",
"description": "
IconizedMenu automatically adds favicons in front of menu links
",
"keywords": ["yii", "extension", "
favicon", "menu", "icon
"],
"homepage": "https://github.com/
samdark/yii2-iconized-menu
-widget",
"name": "
myname/my
widget",
"description": "
My widget is a cool widget that does everything
",
"keywords": ["yii", "extension", "
widget", "cool
"],
"homepage": "https://github.com/
myname/yii2-mywidget
-widget",
"type": "yii2-extension",
"license": "BSD-3-Clause",
"authors": [
{
"name": "
Alexander Makarov
",
"email": "
sam@rmcreative.ru
"
"name": "
John Doe
",
"email": "
doe@example.com
"
}
],
"require": {
...
...
@@ -80,16 +80,16 @@ If your extension classes reside directly in repository root use PSR-4 the follo
},
"autoload": {
"psr-4": {
"
samdark\\widgets
\\": ""
"
myname\\mywidget
\\": ""
}
}
}
```
In the above
`
samdark/yii2-iconized-menu-
widget`
is the package name that will be registered
In the above
`
myname/my
widget`
is the package name that will be registered
at
[
Packagist
](
https://packagist.org
)
. It is common for it to match your github repository.
We're using
`psr-4`
autoloader and mapping
`
samdark\widgets
`
namespace to the root directory where our classes reside.
We're using
`psr-4`
autoloader and mapping
`
myname\mywidget
`
namespace to the root directory where our classes reside.
More details can be found in the
[
composer documentation
](
http://getcomposer.org/doc/04-schema.md#autoload
)
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment