-
Notifications
You must be signed in to change notification settings - Fork 1
Coding
When developing within the project of World Wide Importers, there is a need for certain conventions within the code. They will be listed below.
The .scss
written within this project need to follow certain criteria.
- Properly indent all rules with the parent.
Good
.partent {
.child0 {
margin-top: 2em;
}
.child1 {
margin-bottom: 2em;
}
}
Wrong
.partent .child0 {
margin-top: 2em;
}
.parent .child1 {
margin-bottom: 2em;
}
Within the PHP code of World Wide Importers we need to follow certain conventions. In the list below you'll find all our 'rules' we apply.
The maner of making a function within this repository.
Good
function functionName(param) {
#code
}
Wrong
function functionName(param)
{
#code
}
Is the made function used more then two times? Then place it in src/inc/functions.php
.
When data needs to be displayed in the view of the page use print();
. The use of any kind of echo "";
is prohibited
When making/modifying a .php
file always include src/inc/config.php
. This will ensure you have access to functions and static variables listed in src/inc/functions.php
.
Do this by adding the following line at the top of your controller file:
require('inc/config.php');