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
e3cb887c
Commit
e3cb887c
authored
Apr 15, 2012
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more todos, code style
parent
6d917566
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
7 deletions
+52
-7
code_style.md
docs/code_style.md
+50
-6
todo.md
todo.md
+2
-1
No files found.
docs/code_style.md
View file @
e3cb887c
Yii2 core code style
====================
Yii2 code standard
==================
This code standard is used for all the Yii2 core classes and can be applied to
your application in order to achieve consistency among your team. Also it will
help in case you want to opensource code.
PHP file formatting
-------------------
### General
-
Do not use
`?>`
for files containing PHP code only.
-
Files should be encoded in UTF-8.
### Indentation
All major PHP frameworks and libraries are using spaces. Common number is four:
-
Symfony 2: four spaces
-
Zend Framework 1: four spaces
-
Zend Framework 2: four spaces
-
Pear: four spaces
### Maximum Line Length
We're not strictly limiting maximum line length but sticking to 80 characters
where possible.
### Line Termination
Proposals
---------
### Brackets
...
...
@@ -46,4 +74,20 @@ public function __construct($connection)
{
$this->connection = $connection;
}
~~~
\ No newline at end of file
~~~
### Other library and framework standards
It's good to be consistent with other frameworks and libraries whose components
will be possibly used with Yii2. That's why when there are no objective reasons
to use different style we should use one that's common among most of the popular
libraries and frameworks.
That's not only about PHP but about JavaScript as well. Since we're using jQuery
a lot it's better to be consistent with its style as well.
-
[
Symfony 2
](
http://symfony.com/doc/current/contributing/code/standards.html
)
-
[
Zend Framework 1
](
http://framework.zend.com/manual/en/coding-standard.coding-style.html
)
-
[
Zend Framework 2
](
http://framework.zend.com/wiki/display/ZFDEV2/Coding+Standards
)
-
[
Pear
](
http://pear.php.net/manual/en/standards.php
)
-
[
jQuery
](
http://docs.jquery.com/JQuery_Core_Style_Guidelines
)
\ No newline at end of file
todo.md
View file @
e3cb887c
...
...
@@ -13,7 +13,8 @@
*
type conversion rules
*
CompareValidator::clientValidateAttribute(): search for "CHtml::activeId"
*
FileValidator, UniqueValidator, ExistValidator, DateValidator: TBD
*
consider merging UniqueValidator and ExistValidator and using a NOT property.
*
consider merging UniqueValidator and ExistValidator and using a NOT property: array('!exist', …)
*
when getting errors from getErrors it will be good to have which validator (at least type) failed exactly.
-
console command support
[
DONE
]
-
built-in console commands
+
api doc builder
...
...
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