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
857feeb6
Commit
857feeb6
authored
Dec 12, 2013
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated code style, added autoloading and prefix examples
parent
e748455d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
extensions.md
docs/guide/extensions.md
+28
-3
No files found.
docs/guide/extensions.md
View file @
857feeb6
...
...
@@ -10,9 +10,34 @@ Code style
using the following syntax: e.g.
`[[name()]]`
,
`[[name\space\MyClass::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.
-
Extension SHOULD NOT use class prefixes.
-
Extension SHOULD provide a valid PSR-0 autoloading configuration in
`composer.json`
-
Especially for core components (eg.
`WebUser`
) additional functionality SHOULD be implemented using behaviors or traits instead subclassing.
-
Extension SHOULD NOT use class prefixes (i.e.
`TbNavBar`
,
`EMyWidget`
, etc.)
-
Extension SHOULD provide a valid PSR-0 autoloading configuration in
`composer.json`
**Example 1: Code in repository root**
```
./Class.php
```
```
"autoload": {
"psr-0": { "vendor\\package\\": "" }
},
```
**Example 2: Code in repository subfolder `./src`**
```
./src/vendor/package/Class.php
```
```
"autoload": {
"psr-0": { "vendor\\package\\": "./src" }
},
```
### Namespace and package names
...
...
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